Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/ci-agents.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI Agents

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
NX_NON_NATIVE_HASHER: true
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

jobs:
# Main CI job that orchestrates and executes all tasks with Nx Agents
main:
runs-on: ubuntu-latest
name: CI with Nx Agents
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4

- name: Install dependencies
run: npm ci

- name: Start Nx Cloud CI run with agents
run: ./node_modules/.bin/nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

# Run all CI tasks with Nx Cloud distribution
- name: Run CI tasks
run: npx nx affected -t format:check lint unit-test int-test e2e-test build --configuration=ci

# Test-release packages
- name: Test-release packages
run: npx pkg-pr-new publish "packages/**/dist"

# Nx Cloud Agents for distributed task execution
agents:
runs-on: ubuntu-latest
name: Nx Cloud Agent
timeout-minutes: 60
strategy:
matrix:
agent: [1, 2, 3]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
run: npm ci

- name: Start Nx Cloud Agent ${{ matrix.agent }}
run: ./node_modules/.bin/nx-cloud start-agent --with-deps

# Optional: Stop agent after completion
- name: Stop Nx Cloud Agent ${{ matrix.agent }}
if: always()
run: ./node_modules/.bin/nx-cloud stop-agent
continue-on-error: true
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
]
}
},
"nxv-env-setup": {
"cache": true
},
"nxv-pkg-install": {
"parallelism": false
},
Expand Down
254 changes: 254 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"memfs": "^4.5.0",
"minimatch": "^10.0.1",
"moment": "^2.30.1",
"nx-cloud": "^19.1.0",
"pkg-pr-new": "^0.0.54",
"prettier": "^3.4.1",
"react": "18.3.1",
Expand Down
Loading