1515
1616jobs :
1717 main :
18- name : Nx Cloud
18+ name : Nx Cloud - Main Job
1919 runs-on : ubuntu-latest
2020 steps :
2121 - name : Checkout
@@ -31,15 +31,46 @@ jobs:
3131 cache : pnpm
3232 cache-dependency-path : pnpm-lock.yaml
3333 - name : Install dependencies
34- run : pnpm install --frozen-lockfile
35- - name : Get base and head commits for `nx affected`
36- uses : nrwl/nx-set-shas@v4.3.0
34+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
35+ - name : Get appropriate base and head commits for `nx affected` commands
36+ uses : nrwl/nx-set-shas@v3
3737 with :
38- main-branch-name : main
38+ main-branch-name : ' main'
39+ - run : |
40+ echo "BASE: ${{ env.NX_BASE }}"
41+ echo "HEAD: ${{ env.NX_HEAD }}"
42+ - name : Start CI Orchestrator
43+ run : npx nx-cloud start-ci-run
3944 - name : Run Tests
4045 run : pnpm run test:pr
46+ - name : Stop Agents
47+ run : npx nx-cloud stop-all-agents
4148 - name : Upload coverage to Codecov
4249 uses : codecov/codecov-action@v3
50+ agents :
51+ name : Nx Cloud - Agents
52+ runs-on : ubuntu-latest
53+ timeout-minutes : 10
54+ strategy :
55+ matrix :
56+ agent : [1, 2, 3]
57+ steps :
58+ - name : Checkout
59+ uses : actions/checkout@v4.2.2
60+ with :
61+ fetch-depth : 0
62+ - name : Setup pnpm
63+ uses : pnpm/action-setup@v4.1.0
64+ - name : Setup Node
65+ uses : actions/setup-node@v3
66+ with :
67+ node-version-file : .nvmrc
68+ cache : pnpm
69+ cache-dependency-path : pnpm-lock.yaml
70+ - name : Install dependencies
71+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
72+ - name : Start Nx Agent ${{ matrix.agent }}
73+ run : npx nx-cloud start-agent
4374 format :
4475 name : Format
4576 runs-on : ubuntu-latest
5788 cache : pnpm
5889 cache-dependency-path : pnpm-lock.yaml
5990 - name : Install dependencies
60- run : pnpm install --frozen-lockfile
91+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
6192 - name : Run prettier
6293 run : pnpm run test:format
6394 test-react-17 :
@@ -78,17 +109,15 @@ jobs:
78109 cache : pnpm
79110 cache-dependency-path : pnpm-lock.yaml
80111 - name : Install dependencies
81- run : pnpm install --frozen-lockfile
82- - name : Get base and head commits for `nx affected`
83- uses : nrwl/nx-set-shas@v4.3.0
84- with :
85- main-branch-name : main
112+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
113+ - name : Derive appropriate SHAs for base and head for `nx affected` commands
114+ uses : nrwl/nx-set-shas@v2
86115 - name : Run Tests
87116 uses : nick-fields/retry@v2.8.3
88117 with :
89118 timeout_minutes : 5
90119 max_attempts : 3
91- command : pnpm nx affected --targets=test:lib
120+ command : npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }}
92121 env :
93122 NX_CLOUD_DISTRIBUTED_EXECUTION : false
94123 REACTJS_VERSION : 17
0 commit comments