Update vitest monorepo to v5 #9558
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: [ 22, 24 ] | |
| env: | |
| FORCE_COLOR: 1 | |
| name: Node ${{ matrix.node }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | |
| env: | |
| FORCE_COLOR: 0 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: pnpm | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: .nx/cache | |
| key: nx-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }} | |
| restore-keys: | | |
| nx-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}- | |
| nx-${{ runner.os }}-node${{ matrix.node }}- | |
| - uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5 | |
| if: github.event_name == 'pull_request' | |
| - run: pnpm install --prefer-offline --frozen-lockfile | |
| - run: pnpm format:check | |
| - run: pnpm lint | |
| - name: Test affected (PRs) | |
| if: github.event_name == 'pull_request' | |
| run: pnpm exec nx affected -t test --output-style=static | |
| - name: Test all (main) | |
| if: github.event_name == 'push' | |
| run: pnpm test:ci | |
| - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7 | |
| - uses: tryghost/actions/actions/slack-build@d18acd020860965a6b77219c3b35c9025aa59e7e # main | |
| if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| with: | |
| status: ${{ job.status }} | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| required-checks-pass: | |
| runs-on: ubuntu-latest | |
| name: Required checks pass | |
| permissions: {} | |
| needs: [test] | |
| if: always() | |
| steps: | |
| - name: Verify all required jobs succeeded | |
| if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
| run: exit 1 |