CI: fix test and test coverage #3862
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - v* | |
| - dev* | |
| paths: | |
| - "**/*.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - "**/*.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".github/workflows/test.yml" | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Set up Go 1.x | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ^1.21 | |
| - name: Checkout codebase | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check Go modules | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod go.sum | |
| go mod verify | |
| - name: Run tests with coverage | |
| run: go test ./... -v -timeout=1h -coverprofile=coverage.out -covermode=atomic | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| verbose: true | |
| fail_ci_if_error: true | |
| disable_search: true | |
| files: ./coverage.out | |
| token: ${{ secrets.CODECOV_TOKEN }} |