@@ -7,34 +7,90 @@ concurrency:
7
7
cancel-in-progress : true
8
8
9
9
env :
10
+ NX_CLOUD_DISTRIBUTED_EXECUTION : true
11
+ NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT : 3
10
12
NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13
+ NX_CLOUD_AUTH_TOKEN : ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
11
14
12
15
jobs :
13
16
main :
14
- name : Nx Cloud
15
- uses :
nrwl/ci/.github/workflows/[email protected]
16
- with :
17
- node-version : 18.16.0
18
- pnpm-version : 8.6.0
19
- main-branch-name : alpha
20
- artifacts-name : nx-cloud-artifact
21
- artifacts-path : |
22
- **/build/**
23
- **/coverage/**
24
- !**/node_modules/**
25
- parallel-commands : |
26
- npx nx test:format
27
- npx nx affected --targets=test:eslint,test:types,test:build,test:lib
28
- codecov :
29
- name : Codecov
30
- needs : main
17
+ name : Nx Cloud - Main Job
31
18
runs-on : ubuntu-latest
32
19
steps :
33
20
- uses : actions/checkout@v3
34
- - name : Downloading artifacts
35
- uses : actions/download-artifact@v3
36
21
with :
37
- name : nx-cloud-artifact
38
- path : .
22
+ fetch-depth : 0
23
+ - name : Setup pnpm
24
+
25
+ with :
26
+ version : 8
27
+ - name : Setup Node
28
+ uses : actions/setup-node@v3
29
+ with :
30
+ node-version : 18.16.0
31
+ cache : ' pnpm'
32
+ - name : Install dependencies
33
+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
34
+ - name : Get appropriate base and head commits for `nx affected` commands
35
+ uses : nrwl/nx-set-shas@v3
36
+ with :
37
+ main-branch-name : ' alpha'
38
+ - run : |
39
+ echo "BASE: ${{ env.NX_BASE }}"
40
+ echo "HEAD: ${{ env.NX_HEAD }}"
41
+ - name : Start CI Orchestrator
42
+ run : npx nx-cloud start-ci-run
43
+ - name : Run Tests
44
+ uses :
nick-fields/[email protected]
45
+ with :
46
+ timeout_minutes : 5
47
+ max_attempts : 3
48
+ command : npx nx affected --targets=test:eslint,test:lib,test:types,test:build
49
+ - name : Stop Agents
50
+ run : npx nx-cloud stop-all-agents
39
51
- name : Upload coverage to Codecov
40
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
+
66
+ with :
67
+ version : 8
68
+ - name : Setup Node
69
+ uses : actions/setup-node@v3
70
+ with :
71
+ node-version : 18.16.0
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
77
+ format :
78
+ name : Format
79
+ runs-on : ubuntu-latest
80
+ steps :
81
+ - uses : actions/checkout@v3
82
+ with :
83
+ fetch-depth : 0
84
+ - name : Setup pnpm
85
+
86
+ with :
87
+ version : 8
88
+ - name : Setup Node
89
+ uses : actions/setup-node@v3
90
+ with :
91
+ node-version : 18.16.0
92
+ cache : ' pnpm'
93
+ - name : Install dependencies
94
+ run : pnpm --filter "./packages/**" --filter query --prefer-offline install
95
+ - name : Run prettier
96
+ run : pnpm run test:format
0 commit comments