name: test on: push: branches: [master] pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Build run: go build ./... - name: Vet run: go vet ./... - name: Test run: go test ./... -race -shuffle=on -coverprofile=coverage.out -covermode=atomic - name: Coverage summary run: | echo '### Coverage' >> "$GITHUB_STEP_SUMMARY" echo '```' >> "$GITHUB_STEP_SUMMARY" go tool cover -func=coverage.out | tail -1 >> "$GITHUB_STEP_SUMMARY" echo '```' >> "$GITHUB_STEP_SUMMARY" - uses: actions/upload-artifact@v4 with: name: coverage path: coverage.out