Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

pr.yml

73 lines2.0 KB

1name: PR
2​
3on:
4 pull_request:
5​
6concurrency:
7 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
8 cancel-in-progress: true
9​
10env:
11 NX_CLOUD_DISTRIBUTED_EXECUTION: false
12 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13 NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
14​
15jobs:
16 main:
17 name: Nx Cloud - Main Job
18 runs-on: ubuntu-latest
19 steps:
20 - name: Checkout
21 uses: actions/checkout@v6.0.1
22 with:
23 fetch-depth: 0
24 - name: Start Nx Agents
25 run: npx nx-cloud start-ci-run
26 - name: Setup Tools
27 uses: tanstack/config/.github/setup@main
28 - name: Get base and head commits for `nx affected`
29 uses: nrwl/nx-set-shas@v4.4.0
30 with:
31 main-branch-name: v4
32 - name: Run Tests
33 run: pnpm run test:pr --parallel=3
34 - name: Stop Agents
35 run: npx nx-cloud stop-all-agents
36 format:
37 name: Format
38 runs-on: ubuntu-latest
39 steps:
40 - name: Checkout
41 uses: actions/checkout@v6.0.1
42 with:
43 fetch-depth: 0
44 - name: Setup Tools
45 uses: tanstack/config/.github/setup@main
46 - name: Run prettier
47 run: pnpm run test:format
48 test-react-version:
49 name: 'Test React Version'
50 runs-on: ubuntu-latest
51 strategy:
52 matrix:
53 react-version: [17, 18]
54 steps:
55 - name: Checkout
56 uses: actions/checkout@v6.0.1
57 with:
58 fetch-depth: 0
59 - name: Setup Tools
60 uses: tanstack/config/.github/setup@main
61 - name: Get base and head commits for `nx affected`
62 uses: nrwl/nx-set-shas@v4.4.0
63 with:
64 main-branch-name: v4
65 - name: Run Tests for React ${{ matrix.react-version }}
66 uses: nick-fields/retry@v2.8.3
67 with:
68 timeout_minutes: 5
69 max_attempts: 3
70 command: npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }}
71 env:
72 NX_CLOUD_DISTRIBUTED_EXECUTION: false
73 REACTJS_VERSION: ${{ matrix.react-version }}