|
1 | 1 | name: pr
|
| 2 | + |
2 | 3 | on: [pull_request]
|
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} |
| 7 | + cancel-in-progress: true |
| 8 | + |
3 | 9 | env:
|
4 |
| - NX_DAEMON: false |
| 10 | + NX_CLOUD_DISTRIBUTED_EXECUTION: true |
| 11 | + NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3 |
5 | 12 | NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
| 13 | + NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} |
| 14 | + |
6 | 15 | jobs:
|
7 |
| - agent: |
8 |
| - name: 'Nx Cloud Agents' |
| 16 | + main: |
| 17 | + name: Nx Cloud - Main Job |
9 | 18 | runs-on: ubuntu-latest
|
10 |
| - timeout-minutes: 20 |
11 |
| - strategy: |
12 |
| - matrix: |
13 |
| - agent: [1, 2, 3, 4] |
14 | 19 | steps:
|
15 | 20 | - uses: actions/checkout@v3
|
16 | 21 | with:
|
17 | 22 | fetch-depth: 0
|
18 |
| - ref: ${{ github.head_ref }} |
19 |
| - repository: ${{github.event.pull_request.head.repo.full_name}} |
20 |
| - - uses: pnpm/action-setup@v2.2.4 |
| 23 | + - name: Setup pnpm |
| 24 | + uses: pnpm/action-setup@v2.2.4 |
21 | 25 | with:
|
22 | 26 | version: 8
|
23 |
| - - uses: actions/setup-node@v3 |
| 27 | + - name: Setup Node |
| 28 | + uses: actions/setup-node@v3 |
24 | 29 | with:
|
25 | 30 | node-version: 16.14.2
|
26 | 31 | cache: 'pnpm'
|
27 | 32 | - name: Install dependencies
|
28 | 33 | run: pnpm --filter "./packages/**" --filter query --prefer-offline install
|
29 |
| - - name: Start Nx Agent ${{ matrix.agent }} |
30 |
| - run: npx nx-cloud start-agent |
31 |
| - orchestrator: |
32 |
| - name: 'Nx Cloud Orchestrator' |
33 |
| - runs-on: ubuntu-latest |
34 |
| - steps: |
35 |
| - - uses: actions/checkout@v3 |
36 |
| - with: |
37 |
| - fetch-depth: 0 |
38 |
| - ref: ${{ github.head_ref }} |
39 |
| - repository: ${{github.event.pull_request.head.repo.full_name}} |
40 |
| - - uses: pnpm/action-setup@v2.2.4 |
41 |
| - with: |
42 |
| - version: 8 |
43 |
| - - uses: actions/setup-node@v3 |
| 34 | + - name: Get appropriate base and head commits for `nx affected` commands |
| 35 | + uses: nrwl/nx-set-shas@v3 |
44 | 36 | with:
|
45 |
| - node-version: 16.14.2 |
46 |
| - cache: 'pnpm' |
47 |
| - - name: Install dependencies |
48 |
| - run: pnpm --filter "./packages/**" --filter query --prefer-offline install |
49 |
| - - name: Derive appropriate SHAs for base and head for `nx affected` commands |
50 |
| - uses: nrwl/nx-set-shas@v2 |
| 37 | + main-branch-name: 'main' |
51 | 38 | - run: |
|
52 | 39 | echo "BASE: ${{ env.NX_BASE }}"
|
53 | 40 | echo "HEAD: ${{ env.NX_HEAD }}"
|
54 | 41 | - name: Start CI Orchestrator
|
55 | 42 | run: npx nx-cloud start-ci-run
|
56 |
| - - name: Run All Checks |
| 43 | + - name: Run Tests |
57 | 44 | uses: nick-fields/retry@v2.8.3
|
58 |
| - env: |
59 |
| - BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} |
60 | 45 | with:
|
61 | 46 | timeout_minutes: 5
|
62 | 47 | max_attempts: 3
|
63 |
| - command: npx nx affected --targets=test:eslint,test:types,test:build,test:lib --base=${{ github.event.pull_request.base.sha }} |
| 48 | + command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build |
64 | 49 | - name: Stop Agents
|
65 | 50 | run: npx nx-cloud stop-all-agents
|
66 | 51 | - name: Upload coverage to Codecov
|
67 | 52 | uses: codecov/codecov-action@v3
|
| 53 | + agents: |
| 54 | + name: Nx Cloud - Agents |
| 55 | + runs-on: ubuntu-latest |
| 56 | + timeout-minutes: 10 |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + agent: [1, 2, 3] |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v3 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + - name: Setup pnpm |
| 65 | + uses: pnpm/action-setup@v2.2.4 |
| 66 | + with: |
| 67 | + version: 8 |
| 68 | + - name: Setup Node |
| 69 | + uses: actions/setup-node@v3 |
| 70 | + with: |
| 71 | + node-version: 16.14.2 |
| 72 | + cache: 'pnpm' |
| 73 | + - name: Install dependencies |
| 74 | + run: pnpm --filter "./packages/**" --filter query --prefer-offline install |
| 75 | + - name: Start Nx Agent ${{ matrix.agent }} |
| 76 | + run: npx nx-cloud start-agent |
68 | 77 | format:
|
69 |
| - name: 'Format' |
| 78 | + name: Format |
70 | 79 | runs-on: ubuntu-latest
|
71 | 80 | steps:
|
72 | 81 | - uses: actions/checkout@v3
|
73 | 82 | with:
|
74 | 83 | fetch-depth: 0
|
75 |
| - ref: ${{ github.head_ref }} |
76 |
| - repository: ${{github.event.pull_request.head.repo.full_name}} |
77 |
| - - uses: pnpm/action-setup@v2.2.4 |
| 84 | + - name: Setup pnpm |
| 85 | + uses: pnpm/action-setup@v2.2.4 |
78 | 86 | with:
|
79 | 87 | version: 8
|
80 |
| - - uses: actions/setup-node@v3 |
| 88 | + - name: Setup Node |
| 89 | + uses: actions/setup-node@v3 |
81 | 90 | with:
|
82 | 91 | node-version: 16.14.2
|
83 | 92 | cache: 'pnpm'
|
84 | 93 | - name: Install dependencies
|
85 | 94 | run: pnpm --filter "./packages/**" --filter query --prefer-offline install
|
86 |
| - - run: pnpm run test:format |
| 95 | + - name: Run prettier |
| 96 | + run: pnpm run test:format |
87 | 97 | test-react-17:
|
88 | 98 | name: 'Test React 17'
|
89 | 99 | runs-on: ubuntu-latest
|
@@ -111,4 +121,5 @@ jobs:
|
111 | 121 | max_attempts: 3
|
112 | 122 | command: npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }}
|
113 | 123 | env:
|
| 124 | + NX_CLOUD_DISTRIBUTED_EXECUTION: false |
114 | 125 | REACTJS_VERSION: 17
|
0 commit comments