testing Nx distributed builds #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Distributed test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
NX_CLOUD_DISTRIBUTED_EXECUTION: true | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
# keep this number in sync with the number of agents in the matrix below | |
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3 | |
jobs: | |
agents: | |
name: Nx Cloud Agents | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
# keep this array in sync with the number of agents in | |
# NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT above | |
agent: [1, 2, 3, 3] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2.2.4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- run: pnpm install --frozen-lockfile | |
- name: Start Nx Agent ${{ matrix.agent }} | |
run: pnpm nx-cloud start-agent | |
env: | |
NX_AGENT_NAME: ${{matrix.agent}} | |
pr: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- uses: nrwl/nx-set-shas@v3 | |
- uses: pnpm/action-setup@v2.2.4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm nx-cloud start-ci-run | |
- run: pnpm nx run-many -t test lint build e2e build-storybooks | |
- run: pnpm nx-cloud stop-all-agents |