@@ -2,12 +2,15 @@ name: pr
22on : [pull_request]
33env :
44 NX_DAEMON : false
5- NX_VERBOSE_LOGGING : true
65 NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
76jobs :
8- test :
9- name : ' Test '
7+ agent :
8+ name : ' Nx Cloud Agents '
109 runs-on : ubuntu-latest
10+ timeout-minutes : 20
11+ strategy :
12+ matrix :
13+ agent : [1, 2, 3, 4]
1114 steps :
1215 - uses : actions/checkout@v3
1316 with :
@@ -19,20 +22,14 @@ jobs:
1922 version : 7
2023 - uses : actions/setup-node@v3
2124 with :
22- node-version : 16.19 .0
25+ node-version : 18.16 .0
2326 cache : ' pnpm'
2427 - name : Install dependencies
2528 run : pnpm --filter "./packages/**" --filter query --prefer-offline install
26- - name : Run Tests
27- uses :
nick-fields/[email protected] 28- with :
29- command : pnpm test:lib --base=${{ github.event.pull_request.base.sha }}
30- timeout_minutes : 5
31- max_attempts : 3
32- - name : Upload coverage to Codecov
33- uses : codecov/codecov-action@v3
34- lint :
35- name : ' Lint'
29+ - name : Start Nx Agent ${{ matrix.agent }}
30+ run : npx nx-cloud start-agent
31+ orchestrator :
32+ name : ' Nx Cloud Orchestrator'
3633 runs-on : ubuntu-latest
3734 steps :
3835 - uses : actions/checkout@v3
@@ -45,30 +42,29 @@ jobs:
4542 version : 7
4643 - uses : actions/setup-node@v3
4744 with :
48- node-version : 16.14.2
45+ node-version : 18. 16.0
4946 cache : ' pnpm'
5047 - name : Install dependencies
5148 run : pnpm --filter "./packages/**" --filter query --prefer-offline install
52- - run : pnpm run test:eslint --base=${{ github.event.pull_request.base.sha }}
53- typecheck :
54- name : ' Typecheck'
55- runs-on : ubuntu-latest
56- steps :
57- - uses : actions/checkout@v3
58- with :
59- fetch-depth : 0
60- ref : ${{ github.head_ref }}
61- repository : ${{github.event.pull_request.head.repo.full_name}}
62- 63- with :
64- version : 7
65- - uses : actions/setup-node@v3
49+ - name : Derive appropriate SHAs for base and head for `nx affected` commands
50+ uses : nrwl/nx-set-shas@v2
51+ - run : |
52+ echo "BASE: ${{ env.NX_BASE }}"
53+ echo "HEAD: ${{ env.NX_HEAD }}"
54+ - name : Start CI Orchestrator
55+ run : npx nx-cloud start-ci-run
56+ - name : Run All Checks
57+ uses :
nick-fields/[email protected] 58+ env :
59+ BUNDLEWATCH_GITHUB_TOKEN : ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
6660 with :
67- node-version : 16.14.2
68- cache : ' pnpm'
69- - name : Install dependencies
70- run : pnpm --filter "./packages/**" --filter query --prefer-offline install
71- - run : pnpm run test:types --base=${{ github.event.pull_request.base.sha }}
61+ timeout_minutes : 5
62+ max_attempts : 3
63+ command : npx nx affected --targets=test:eslint,test:types,test:build,test:lib --base=${{ github.event.pull_request.base.sha }}
64+ - name : Stop Agents
65+ run : npx nx-cloud stop-all-agents
66+ - name : Upload coverage to Codecov
67+ uses : codecov/codecov-action@v3
7268 format :
7369 name : ' Format'
7470 runs-on : ubuntu-latest
8379 version : 7
8480 - uses : actions/setup-node@v3
8581 with :
86- node-version : 16.14.2
82+ node-version : 18. 16.0
8783 cache : ' pnpm'
8884 - name : Install dependencies
8985 run : pnpm --filter "./packages/**" --filter query --prefer-offline install
9086 - run : pnpm run test:format --base=${{ github.event.pull_request.base.sha }}
91- test-build :
92- name : ' Test Build'
93- runs-on : ubuntu-latest
94- steps :
95- - uses : actions/checkout@v3
96- 97- with :
98- version : 7
99- - uses : actions/setup-node@v3
100- with :
101- node-version : 16.14.2
102- cache : ' pnpm'
103- - name : Install dependencies
104- run : pnpm --filter "./packages/**" --filter query --prefer-offline install
105- - run : pnpm run test:build
106- env :
107- BUNDLEWATCH_GITHUB_TOKEN : ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
0 commit comments