Repository navigation
chore: update dependencies #151
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: check | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| permissions: | |
| contents: read | |
| env: | |
| # Go version whose test run publishes the coverage report. | |
| COVERAGE_GO_VERSION: '1.27.x' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Latest patch release of each supported Go minor version. | |
| go: ['1.26.x', '1.27.x'] | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v7 | |
| - name: setup go build environment | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| check-latest: true | |
| cache: true | |
| - name: linter | |
| run: make mod deps linter govulncheck GOPATH=$(go env GOPATH) | |
| - name: generated documentation is up to date | |
| run: make gendoccheck GOPATH=$(go env GOPATH) | |
| - name: go.mod and go.sum are tidy | |
| run: make modcheck GOPATH=$(go env GOPATH) | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ['1.26.x', '1.27.x'] | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v7 | |
| - name: setup go build environment | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| check-latest: true | |
| cache: true | |
| - name: unit tests | |
| run: make mod deps test GOPATH=$(go env GOPATH) | |
| - name: coverage report | |
| if: matrix.go == env.COVERAGE_GO_VERSION | |
| uses: coverallsapp/github-action@v2 | |
| continue-on-error: true | |
| with: | |
| file: target/report/coverage.out | |
| format: golang | |
| - name: hash go files | |
| if: matrix.go == env.COVERAGE_GO_VERSION | |
| id: go_hash | |
| run: echo "value=${{ hashFiles('**/*.go','!vendor/**','!examples/**') }}" >>"$GITHUB_OUTPUT" | |
| - name: cache coverage | |
| if: matrix.go == env.COVERAGE_GO_VERSION | |
| id: cover_cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: target/report/coverage.out | |
| key: go_cover_profile_${{ steps.go_hash.outputs.value }} | |
| bench: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ['1.26.x', '1.27.x'] | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v7 | |
| - name: setup go build environment | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| check-latest: true | |
| cache: true | |
| - name: run benchmarks | |
| run: make mod bench GOPATH=$(go env GOPATH) |