ci: fix v4 branch ci #11130
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: pr | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NX_CLOUD_DISTRIBUTED_EXECUTION: false | |
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
| NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
| jobs: | |
| main: | |
| name: Nx Cloud - Main Job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Start Nx Agents | |
| run: npx nx-cloud start-ci-run | |
| - name: Setup Tools | |
| uses: tanstack/config/.github/setup@main | |
| - name: Get base and head commits for `nx affected` | |
| uses: nrwl/nx-set-shas@v4.1.2 | |
| - name: Run Tests | |
| run: pnpm run test:pr --parallel=3 | |
| - name: Stop Agents | |
| run: npx nx-cloud stop-all-agents | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| format: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4.1.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm --filter "./packages/**" --filter query --prefer-offline install | |
| - name: Run prettier | |
| run: pnpm run test:format | |
| test-react-version: | |
| name: 'Test React Version' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| react-version: [17, 18] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.head_ref }} | |
| repository: ${{github.event.pull_request.head.repo.full_name}} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4.1.0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm --filter "./packages/**" --filter query --prefer-offline install | |
| - name: Derive appropriate SHAs for base and head for `nx affected` commands | |
| uses: nrwl/nx-set-shas@v2 | |
| - name: Run Tests for React ${{ matrix.react-version }} | |
| uses: nick-fields/retry@v2.8.3 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 3 | |
| command: npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }} | |
| env: | |
| NX_CLOUD_DISTRIBUTED_EXECUTION: false | |
| REACTJS_VERSION: ${{ matrix.react-version }} |