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@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # 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@e602fada7ad5987b0f7b1905e7a99ea1c661514c # 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@effade3b0d63f664a12c0a60a102a37b66821bd2 # 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