Merge branch 'fix-scanning-alerts' #234
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: Tests | |
| on: [push] | |
| jobs: | |
| tests: | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| env: | |
| - os: ubuntu-latest | |
| coverage: true | |
| generate-check: true | |
| - os: macos-latest | |
| - os: windows-latest | |
| continue-on-error: true | |
| runs-on: ${{ matrix.env.os }} | |
| steps: | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - uses: actions/checkout@v4 | |
| - name: Check if generated files are up to date | |
| if: matrix.env.generate-check | |
| run: | | |
| # Run go generate | |
| go generate ./... | |
| # Check if any files were modified | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "Generated files are out of date. Please run 'go generate ./...' and commit the changes." | |
| git diff | |
| exit 1 | |
| fi | |
| - run: go vet ./... | |
| - run: | | |
| PREFIX="github.com/${GITHUB_REPOSITORY}" | |
| go test -v \ | |
| ${{ matrix.env.coverage && '-coverprofile=profile.cov' }} \ | |
| $( | |
| go list ./... \ | |
| | grep -v "${PREFIX}/cmd" \ | |
| | grep -v "${PREFIX}/testvectors" \ | |
| | grep -v "${PREFIX}/pkg/cinodefs/protobuf" \ | |
| | grep -v "${PREFIX}/pkg/datastore/testutils/generate" \ | |
| ) | |
| continue-on-error: ${{ matrix.env['continue-on-error'] }} | |
| - uses: shogo82148/actions-goveralls@v1 | |
| if: ${{ matrix.env.coverage }} | |
| with: | |
| path-to-profile: profile.cov | |
| - uses: codecov/codecov-action@v5 | |
| if: ${{ matrix.env.coverage }} | |
| with: | |
| files: profile.cov |