chore(deps): fix vulnerabilities reported by govulncheck (#196) #373
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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| name: run tests | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| GOLANGCI_LINT_VERSION: v2.11.3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Go | |
| id: install-go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Download dependencies | |
| run: go mod download | |
| if: steps.install-go.outputs.cache-hit != 'true' | |
| - name: Run linter | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: ${{ env.GOLANGCI_LINT_VERSION }} | |
| test: | |
| strategy: | |
| matrix: | |
| go-version: [ "1.25", "1.26" ] | |
| runs-on: ubuntu-latest | |
| env: | |
| GOTESTSUM_VERSION: v1.13.0 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Go | |
| id: install-go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| check-latest: "true" | |
| - name: Cache Go test cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: /home/runner/.cache/go-test-cache | |
| key: ${{ runner.os }}-go-testcache-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-go-testcache- | |
| - name: Download dependencies | |
| run: go mod download | |
| if: steps.install-go.outputs.cache-hit != 'true' | |
| - name: Setup gotestsum | |
| run: go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname -- -covermode=atomic -coverprofile=coverage.out -race ./... | |
| env: | |
| GOCACHE: /home/runner/.cache/go-test-cache | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| files: coverage.out | |
| format: golang | |
| parallel: true | |
| flag-name: go-${{ matrix.go-version }} | |
| test-results: | |
| needs: test | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel-finished: true | |
| - name: Check matrix results | |
| if: ${{ contains(needs.test.result, 'failure') || contains(needs.test.result, 'cancelled') }} | |
| run: exit 1 |