Skip to content

Commit 0004886

Browse files
authoredFeb 17, 2024··
ci: Use Nx Agents (#5356)
1 parent 84c0791 commit 0004886

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed
 

‎.github/workflows/ci.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ jobs:
3535
with:
3636
node-version-file: .nvmrc
3737
cache: pnpm
38+
- name: Start Nx Agents
39+
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3840
- name: Install dependencies
3941
run: pnpm install --frozen-lockfile --prefer-offline
4042
- name: Run Tests
41-
run: pnpm run test:ci
43+
run: pnpm run test:ci --parallel=3
44+
- name: Stop Nx Agents
45+
if: ${{ always() }}
46+
run: npx nx-cloud stop-all-agents
4247
- name: Publish
4348
run: |
4449
git config --global user.name 'Tanner Linsley'

‎.github/workflows/pr.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ jobs:
3232
with:
3333
node-version-file: .nvmrc
3434
cache: pnpm
35+
- name: Start Nx Agents
36+
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3537
- name: Install dependencies
3638
run: pnpm install --frozen-lockfile --prefer-offline
3739
- name: Get base and head commits for `nx affected`
3840
uses: nrwl/nx-set-shas@v3
3941
with:
4042
main-branch-name: 'main'
4143
- name: Run Checks
42-
run: pnpm run test:pr
44+
run: pnpm run test:pr --parallel=3
45+
- name: Stop Nx Agents
46+
if: ${{ always() }}
47+
run: npx nx-cloud stop-all-agents

‎.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
# dependencies
55
node_modules
6+
package-lock.json
7+
yarn.lock
68

79
# builds
810
types
@@ -36,9 +38,8 @@ stats.html
3638

3739
*.log
3840
.DS_Store
39-
node_modules
4041
.cache
41-
dist
42+
.pnpm-store
4243

4344
package-lock.json
4445
yarn.lock

‎.nx/workflows/dynamic-changesets.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
distribute-on:
2+
small-changeset: 8 linux-medium-js
3+
medium-changeset: 10 linux-medium-js
4+
large-changeset: 12 linux-medium-js

‎nx.json

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
"inputs": ["default", "^public"],
4444
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"],
4545
"cache": true
46+
},
47+
"test:format": {
48+
"cache": true,
49+
"inputs": ["{workspaceRoot}/**/*"]
4650
}
4751
}
4852
}

0 commit comments

Comments
 (0)
Please sign in to comment.