new workflow: shellcheck (#31634) #3
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 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| on: | |
| pull_request: | |
| types: ['opened', 'synchronize'] | |
| paths: | |
| - '.github/workflows/unit-test.yaml' | |
| - 'go.sum' | |
| - 'vendor/**' | |
| - '**.go' | |
| # Run this workflow on merges that change go.sum on the default branch. The | |
| # intention is to save a new Go module dependency cache for the default | |
| # branch. This cache is then available to all workflow runs. | |
| # | |
| # Reference: https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching?search-overlay-input=github+action+cache+limit+increase&search-overlay-ask-ai=true#restrictions-for-accessing-a-cache | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/unit-test.yaml' | |
| - 'go.sum' | |
| concurrency: | |
| group: 'unit-${{ github.head_ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: custom-linux-large | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: ./.go-version | |
| - run: bash scripts/gogetcookie.sh | |
| - run: make test | |
| env: | |
| GITHUB_ACTIONS_STAGE: "UNIT_TESTS" | |
| save-artifacts-on-fail: | |
| needs: test | |
| if: ${{ failure() }} | |
| uses: ./.github/workflows/save-artifacts.yaml | |
| comment-on-fail: | |
| needs: test | |
| if: ${{ failure() }} | |
| uses: ./.github/workflows/comment-failure.yaml |