Skip to content

Commit

Permalink
ci: Introduce Nx agents (#6863)
Browse files Browse the repository at this point in the history
* introducing nx agents

* busting cache to get some test runs in

* fixing distribut option

* fixing yml syntax error

* bumping up agent count

* experimenting with parallel and agent count

* kick tires

* rm stuff to break cache

* reordering setup to start agents earlier

* adding in nvmrc file

* making sure pnpm is there for node setup

* kick tires

* Move parallel flag into workflow

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
  • Loading branch information
ZackDeRose and lachlancollins committed Feb 10, 2024
1 parent 7a51c2a commit 59c0d53
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,23 @@ jobs:
with:
node-version-file: .nvmrc
cache: pnpm
- name: Start Agents
run: npx nx-cloud start-ci-run --distribute-on="12 linux-medium-js"
- 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: Start CI Orchestrator
run: npx nx-cloud start-ci-run
- name: Run Tests
run: pnpm run test:pr
run: pnpm run test:pr --parallel=3
- name: Stop Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: packages
agents:
name: Nx Cloud - Agents
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
agent: [1, 2, 3]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent
format:
name: Format
runs-on: ubuntu-latest
Expand Down

0 comments on commit 59c0d53

Please sign in to comment.