15
15
16
16
jobs :
17
17
main :
18
- name : Nx Cloud
18
+ name : Nx Cloud - Main Job
19
19
runs-on : ubuntu-latest
20
20
steps :
21
21
- name : Checkout
@@ -31,15 +31,46 @@ jobs:
31
31
cache : pnpm
32
32
cache-dependency-path : pnpm-lock.yaml
33
33
- 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
37
37
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
39
44
- name : Run Tests
40
45
run : pnpm run test:pr
46
+ - name : Stop Agents
47
+ run : npx nx-cloud stop-all-agents
41
48
- name : Upload coverage to Codecov
42
49
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
+
60
+ with :
61
+ fetch-depth : 0
62
+ - name : Setup pnpm
63
+
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
43
74
format :
44
75
name : Format
45
76
runs-on : ubuntu-latest
57
88
cache : pnpm
58
89
cache-dependency-path : pnpm-lock.yaml
59
90
- name : Install dependencies
60
- run : pnpm install --frozen-lockfile
91
+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
61
92
- name : Run prettier
62
93
run : pnpm run test:format
63
94
test-react-17 :
@@ -78,17 +109,15 @@ jobs:
78
109
cache : pnpm
79
110
cache-dependency-path : pnpm-lock.yaml
80
111
- name : Install dependencies
81
- run : pnpm install --frozen-lockfile
82
- - name : Get base and head commits for `nx affected`
83
-
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
86
115
- name : Run Tests
87
116
uses :
nick-fields/[email protected]
88
117
with :
89
118
timeout_minutes : 5
90
119
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 }}
92
121
env :
93
122
NX_CLOUD_DISTRIBUTED_EXECUTION : false
94
123
REACTJS_VERSION : 17
0 commit comments