From 666dfc97eca504586dbe246505d24b180f9f9618 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 01:53:13 +0200 Subject: [PATCH 1/6] chore: test agents 1 --- .github/workflows/ci-agents.yml | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/ci-agents.yml diff --git a/.github/workflows/ci-agents.yml b/.github/workflows/ci-agents.yml new file mode 100644 index 000000000..d9d049399 --- /dev/null +++ b/.github/workflows/ci-agents.yml @@ -0,0 +1,88 @@ +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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + + # Run format check + - name: Check formatting of affected files + run: npx nx format:check + + # Run linting on affected projects + - name: Lint affected projects + run: npx nx affected:lint --parallel=3 + + # Run unit tests on affected projects + - name: Unit test affected projects + run: npx nx affected -t unit-test --parallel=3 --coverage.enabled + + # Run integration tests on affected projects + - name: Integration test affected projects + run: npx nx affected -t int-test --parallel=3 --coverage.enabled + + # Run e2e tests on affected projects + - name: E2E test affected projects + run: npx nx affected -t e2e-test --parallel=1 + + # Build all projects for package publishing + - name: Build all projects + run: npx nx run-many --target=build --parallel=3 --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: Start Nx Cloud Agent ${{ matrix.agent }} + run: npx nx-cloud start-agent --with-deps + + # Optional: Stop agent after completion + - name: Stop Nx Cloud Agent ${{ matrix.agent }} + if: always() + run: npx nx-cloud stop-agent + continue-on-error: true From 2e9c609e67b86f2038dd95fd0cf893ee72d354c1 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 01:55:38 +0200 Subject: [PATCH 2/6] chore: test agents 2 --- .github/workflows/ci-agents.yml | 6 +- package-lock.json | 254 ++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 258 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-agents.yml b/.github/workflows/ci-agents.yml index d9d049399..a20dcd612 100644 --- a/.github/workflows/ci-agents.yml +++ b/.github/workflows/ci-agents.yml @@ -34,7 +34,7 @@ jobs: run: npm ci - name: Start Nx Cloud CI run with agents - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + run: ./node_modules/.bin/nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Run format check - name: Check formatting of affected files @@ -79,10 +79,10 @@ jobs: fetch-depth: 0 - name: Start Nx Cloud Agent ${{ matrix.agent }} - run: npx nx-cloud start-agent --with-deps + 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: npx nx-cloud stop-agent + run: ./node_modules/.bin/nx-cloud stop-agent continue-on-error: true diff --git a/package-lock.json b/package-lock.json index 53ab456d8..167ddbe29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,6 +95,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", @@ -5534,6 +5535,16 @@ "node": ">=12.4.0" } }, + "node_modules/@nrwl/nx-cloud": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@nrwl/nx-cloud/-/nx-cloud-19.1.0.tgz", + "integrity": "sha512-krngXVPfX0Zf6+zJDtcI59/Pt3JfcMPMZ9C/+/x6rvz4WGgyv1s0MI4crEUM0Lx5ZpS4QI0WNDCFVQSfGEBXUg==", + "dev": true, + "license": "CC-BY-ND-3.0", + "dependencies": { + "nx-cloud": "19.1.0" + } + }, "node_modules/@nx/devkit": { "version": "21.4.1", "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-21.4.1.tgz", @@ -12639,6 +12650,16 @@ "node": "*" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/chrome-launcher": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-1.1.2.tgz", @@ -17572,6 +17593,39 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -23173,6 +23227,40 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", @@ -23594,6 +23682,124 @@ } } }, + "node_modules/nx-cloud": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/nx-cloud/-/nx-cloud-19.1.0.tgz", + "integrity": "sha512-f24vd5/57/MFSXNMfkerdDiK0EvScGOKO71iOWgJNgI1xVweDRmOA/EfjnPMRd5m+pnoPs/4A7DzuwSW0jZVyw==", + "dev": true, + "license": "CC-BY-ND-3.0", + "dependencies": { + "@nrwl/nx-cloud": "19.1.0", + "axios": "^1.6.0", + "chalk": "^4.1.0", + "dotenv": "~10.0.0", + "fs-extra": "^11.1.0", + "ini": "4.1.3", + "node-machine-id": "^1.1.12", + "open": "~8.4.0", + "tar": "6.2.1", + "yargs-parser": ">=21.1.1" + }, + "bin": { + "nx-cloud": "bin/nx-cloud.js" + } + }, + "node_modules/nx-cloud/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/nx-cloud/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/nx-cloud/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/nx-cloud/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nx-cloud/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=10" + } + }, + "node_modules/nx-cloud/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nx-cloud/node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/nx-cloud/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nx/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -28295,6 +28501,24 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar-fs": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", @@ -28346,6 +28570,36 @@ "node": ">= 6" } }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/terminal-size": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/terminal-size/-/terminal-size-4.0.0.tgz", diff --git a/package.json b/package.json index ba7596460..8d5e0badd 100644 --- a/package.json +++ b/package.json @@ -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", From 79c46d4bffe91ee3280a81bf1a5bb5e5c2633d17 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 01:57:05 +0200 Subject: [PATCH 3/6] chore: test agents 3 --- .github/workflows/ci-agents.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-agents.yml b/.github/workflows/ci-agents.yml index a20dcd612..c5be2d931 100644 --- a/.github/workflows/ci-agents.yml +++ b/.github/workflows/ci-agents.yml @@ -78,6 +78,9 @@ jobs: 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 From 36405b33c73beb45f50a3ddf5605f8967d27a6ce Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 02:10:09 +0200 Subject: [PATCH 4/6] chore: test agents 4 --- .github/workflows/ci-agents.yml | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-agents.yml b/.github/workflows/ci-agents.yml index c5be2d931..51649f567 100644 --- a/.github/workflows/ci-agents.yml +++ b/.github/workflows/ci-agents.yml @@ -36,29 +36,9 @@ jobs: - 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 format check - - name: Check formatting of affected files - run: npx nx format:check - - # Run linting on affected projects - - name: Lint affected projects - run: npx nx affected:lint --parallel=3 - - # Run unit tests on affected projects - - name: Unit test affected projects - run: npx nx affected -t unit-test --parallel=3 --coverage.enabled - - # Run integration tests on affected projects - - name: Integration test affected projects - run: npx nx affected -t int-test --parallel=3 --coverage.enabled - - # Run e2e tests on affected projects - - name: E2E test affected projects - run: npx nx affected -t e2e-test --parallel=1 - - # Build all projects for package publishing - - name: Build all projects - run: npx nx run-many --target=build --parallel=3 --configuration=ci + # Run all CI tasks with Nx Cloud distribution + - name: Run CI tasks + run: npx nx run-many -t format:check lint unit-test int-test e2e-test build --configuration=ci # Test-release packages - name: Test-release packages From cada32a076d30ffc736a98066655d3031de85f54 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 02:19:12 +0200 Subject: [PATCH 5/6] chore: test agents 5 --- .github/workflows/ci-agents.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-agents.yml b/.github/workflows/ci-agents.yml index 51649f567..2a901f66d 100644 --- a/.github/workflows/ci-agents.yml +++ b/.github/workflows/ci-agents.yml @@ -38,7 +38,7 @@ jobs: # Run all CI tasks with Nx Cloud distribution - name: Run CI tasks - run: npx nx run-many -t format:check lint unit-test int-test e2e-test build --configuration=ci + run: npx nx affected -t format:check lint unit-test int-test e2e-test build --configuration=ci # Test-release packages - name: Test-release packages From 045fe73ba135727b8402ca33415a8fb85d8cd7c8 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 2 Sep 2025 02:34:29 +0200 Subject: [PATCH 6/6] chore: test agents 6 --- nx.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx.json b/nx.json index 4acf25eda..daae4390d 100644 --- a/nx.json +++ b/nx.json @@ -125,6 +125,9 @@ ] } }, + "nxv-env-setup": { + "cache": true + }, "nxv-pkg-install": { "parallelism": false },