Skip to content

Commit

Permalink
ci: Use Nx Agents (#5356)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Feb 17, 2024
1 parent 84c0791 commit 0004886
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ jobs:
with:
node-version-file: .nvmrc
cache: pnpm
- name: Start Nx Agents
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run Tests
run: pnpm run test:ci
run: pnpm run test:ci --parallel=3
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ jobs:
with:
node-version-file: .nvmrc
cache: pnpm
- name: Start Nx Agents
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'main'
- name: Run Checks
run: pnpm run test:pr
run: pnpm run test:pr --parallel=3
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# dependencies
node_modules
package-lock.json
yarn.lock

# builds
types
Expand Down Expand Up @@ -36,9 +38,8 @@ stats.html

*.log
.DS_Store
node_modules
.cache
dist
.pnpm-store

package-lock.json
yarn.lock
Expand Down
4 changes: 4 additions & 0 deletions .nx/workflows/dynamic-changesets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
distribute-on:
small-changeset: 8 linux-medium-js
medium-changeset: 10 linux-medium-js
large-changeset: 12 linux-medium-js
4 changes: 4 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
"inputs": ["default", "^public"],
"outputs": ["{projectRoot}/build", "{projectRoot}/dist"],
"cache": true
},
"test:format": {
"cache": true,
"inputs": ["{workspaceRoot}/**/*"]
}
}
}

0 comments on commit 0004886

Please sign in to comment.