fix: preserve retry fields WithRequestModifier and WithDebug (#186) #338
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| test-go: | |
| name: Run unit and integration tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.22" | |
| - name: Install dependencies | |
| run: | | |
| go get -t -v ./... | |
| go install ./... | |
| - name: Setup integration test infrastructure | |
| run: | | |
| cd ./example/hasura | |
| docker compose up -d | |
| - name: Run Go unit tests for example/subscription | |
| run: | | |
| rm -rf ./coverage | |
| mkdir -p ./coverage/subscription | |
| pushd example/subscription | |
| go get -t -v ./... | |
| popd | |
| go test -v -race -timeout 3m -cover ./... -args -test.gocoverdir=$PWD/coverage/subscription ./example/subscription/... | |
| - name: Run Go unit tests | |
| run: | | |
| mkdir -p ./coverage/graphql | |
| go test -v -race -timeout 3m -cover ./ ./ident/... ./pkg/... -args -test.gocoverdir=$PWD/coverage/graphql ./... | |
| - name: Go coverage format | |
| if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }} | |
| run: | | |
| go get github.com/boumenot/gocover-cobertura | |
| go install github.com/boumenot/gocover-cobertura | |
| go tool covdata textfmt -i=./coverage/subscription,./coverage/graphql -o ./coverage/coverage.out | |
| gocover-cobertura < ./coverage/coverage.out > coverage.xml | |
| - name: Code Coverage Summary Report | |
| if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }} | |
| uses: irongut/[email protected] | |
| with: | |
| filename: coverage.xml | |
| badge: true | |
| fail_below_min: true | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: true | |
| indicators: true | |
| output: both | |
| thresholds: "60 80" | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} | |
| with: | |
| path: code-coverage-results.md | |
| - name: Dump docker logs on failure | |
| if: failure() | |
| uses: jwalton/gh-docker-logs@v2 |