name: ci on: push: pull_request: jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: go: ["1.19.x", "stable"] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - name: gofmt run: | unformatted="$(gofmt -l .)" if [ -n "$unformatted" ]; then echo "以下文件未格式化:" echo "$unformatted" exit 1 fi - name: vet run: go vet ./... - name: test run: go test -race -count=1 -coverprofile=coverage.out ./... - name: build example run: go build ./example