From f544b8b0a863bcfd868c76f407cfd0967b69cd35 Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 8 Jul 2026 22:20:42 +0200 Subject: [PATCH 1/5] ci: migrate workflows to nx agents --- .github/workflows/pr.yml | 17 +++++++++++++++-- .github/workflows/release.yml | 11 +++++++---- .nx/workflows/agents.yaml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .nx/workflows/agents.yaml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6284ff67..2075c53e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,6 +13,7 @@ concurrency: env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + NX_CLOUD_CONTINUOUS_ASSIGNMENT: true permissions: contents: read @@ -34,8 +35,15 @@ jobs: uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0 with: main-branch-name: main + - name: Start Nx Agents + run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion - name: Run Checks - run: pnpm run test:pr + run: | + pnpm nx record -- pnpm exec tsc --noEmit + pnpm nx affected --targets=test:eslint,test:sherif,test:knip,test:docs,test:lib,test:types,build --exclude='examples/**' + - name: Complete Nx Agents + if: ${{ always() }} + run: npx nx-cloud complete-ci-run preview: name: Preview runs-on: ubuntu-latest @@ -48,7 +56,12 @@ jobs: persist-credentials: false - name: Setup Tools uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main + - name: Start Nx Agents + run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion - name: Build Packages - run: pnpm run build:all + run: pnpm nx run-many --targets=build --exclude='examples/**' - name: Publish Previews run: pnpx pkg-pr-new publish --pnpm './packages/*' + - name: Complete Nx Agents + if: ${{ always() }} + run: npx nx-cloud complete-ci-run diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcf977b6..af23a702 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ concurrency: env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + NX_CLOUD_CONTINUOUS_ASSIGNMENT: true SERVER_PRESET: 'node-server' permissions: @@ -41,15 +42,17 @@ jobs: fi - name: Start Nx Agents if: steps.changesets.outputs.has_changesets == 'true' - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" + run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion - name: Setup Tools uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main - name: Run Tests if: steps.changesets.outputs.has_changesets == 'true' - run: pnpm run test:ci --parallel=3 - - name: Stop Nx Agents + run: | + pnpm nx record -- pnpm exec tsc --noEmit + pnpm nx run-many --targets=test:eslint,test:sherif,test:knip,test:docs,test:lib,test:integration,test:types,build --parallel=3 + - name: Complete Nx Agents if: ${{ always() && steps.changesets.outputs.has_changesets == 'true' }} - run: npx nx-cloud stop-all-agents + run: npx nx-cloud complete-ci-run - name: Enter Pre-Release Mode if: "contains(github.ref_name, '-pre') && !hashFiles('.changeset/pre.json')" run: pnpm changeset pre enter pre diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml new file mode 100644 index 00000000..d894276e --- /dev/null +++ b/.nx/workflows/agents.yaml @@ -0,0 +1,33 @@ +distribute-on: + small-changeset: 3 linux-medium-node24 + medium-changeset: 6 linux-medium-node24 + large-changeset: 10 linux-medium-node24 + +common-js-init-steps: &common-js-init-steps + - name: Checkout + uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/checkout/main.yaml' + + - name: Restore Node Modules Cache + uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/cache/main.yaml' + inputs: + key: 'pnpm-lock.yaml|package.json|pnpm-workspace.yaml|.npmrc' + paths: 'node_modules' + base-branch: 'main' + + - name: Install Node + uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/install-node/main.yaml' + + - name: Install Node Modules + uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/install-node-modules/main.yaml' + + - name: Verify Toolchain + script: | + node --version + pnpm --version + pnpm nx --version + +launch-templates: + linux-medium-node24: + resource-class: 'docker_linux_amd64/medium' + image: 'ubuntu22.04-node24.14-v1' + init-steps: *common-js-init-steps From 398945ba99ede5fb27ba96c70dd1767db85263da Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 8 Jul 2026 22:38:34 +0200 Subject: [PATCH 2/5] ci: keep preview workflow local --- .github/workflows/pr.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2075c53e..8cf61491 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -38,9 +38,7 @@ jobs: - name: Start Nx Agents run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion - name: Run Checks - run: | - pnpm nx record -- pnpm exec tsc --noEmit - pnpm nx affected --targets=test:eslint,test:sherif,test:knip,test:docs,test:lib,test:types,build --exclude='examples/**' + run: pnpm run test:pr - name: Complete Nx Agents if: ${{ always() }} run: npx nx-cloud complete-ci-run @@ -56,12 +54,7 @@ jobs: persist-credentials: false - name: Setup Tools uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main - - name: Start Nx Agents - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion - name: Build Packages - run: pnpm nx run-many --targets=build --exclude='examples/**' + run: pnpm run build:all - name: Publish Previews run: pnpx pkg-pr-new publish --pnpm './packages/*' - - name: Complete Nx Agents - if: ${{ always() }} - run: npx nx-cloud complete-ci-run From 6352a580c486c578e2f11084af5570ffdf645f5d Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 8 Jul 2026 22:48:07 +0200 Subject: [PATCH 3/5] ci: leave release workflow unchanged --- .github/workflows/release.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af23a702..bcf977b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ concurrency: env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - NX_CLOUD_CONTINUOUS_ASSIGNMENT: true SERVER_PRESET: 'node-server' permissions: @@ -42,17 +41,15 @@ jobs: fi - name: Start Nx Agents if: steps.changesets.outputs.has_changesets == 'true' - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion + run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" - name: Setup Tools uses: TanStack/config/.github/setup@b313637fa7d314532b98638f6b57b7b9c169d390 # main - name: Run Tests if: steps.changesets.outputs.has_changesets == 'true' - run: | - pnpm nx record -- pnpm exec tsc --noEmit - pnpm nx run-many --targets=test:eslint,test:sherif,test:knip,test:docs,test:lib,test:integration,test:types,build --parallel=3 - - name: Complete Nx Agents + run: pnpm run test:ci --parallel=3 + - name: Stop Nx Agents if: ${{ always() && steps.changesets.outputs.has_changesets == 'true' }} - run: npx nx-cloud complete-ci-run + run: npx nx-cloud stop-all-agents - name: Enter Pre-Release Mode if: "contains(github.ref_name, '-pre') && !hashFiles('.changeset/pre.json')" run: pnpm changeset pre enter pre From 996c0dfb9be1ac47dcebf164de2986b0c0e46770 Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 8 Jul 2026 22:49:40 +0200 Subject: [PATCH 4/5] ci: reuse default nx agents template --- .github/workflows/pr.yml | 2 +- .nx/workflows/agents.yaml | 33 --------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 .nx/workflows/agents.yaml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8cf61491..9038eba0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,7 +36,7 @@ jobs: with: main-branch-name: main - name: Start Nx Agents - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/agents.yaml" --require-explicit-completion + run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --require-explicit-completion - name: Run Checks run: pnpm run test:pr - name: Complete Nx Agents diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml deleted file mode 100644 index d894276e..00000000 --- a/.nx/workflows/agents.yaml +++ /dev/null @@ -1,33 +0,0 @@ -distribute-on: - small-changeset: 3 linux-medium-node24 - medium-changeset: 6 linux-medium-node24 - large-changeset: 10 linux-medium-node24 - -common-js-init-steps: &common-js-init-steps - - name: Checkout - uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/checkout/main.yaml' - - - name: Restore Node Modules Cache - uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/cache/main.yaml' - inputs: - key: 'pnpm-lock.yaml|package.json|pnpm-workspace.yaml|.npmrc' - paths: 'node_modules' - base-branch: 'main' - - - name: Install Node - uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/install-node/main.yaml' - - - name: Install Node Modules - uses: 'nrwl/nx-cloud-workflows/v6/workflow-steps/install-node-modules/main.yaml' - - - name: Verify Toolchain - script: | - node --version - pnpm --version - pnpm nx --version - -launch-templates: - linux-medium-node24: - resource-class: 'docker_linux_amd64/medium' - image: 'ubuntu22.04-node24.14-v1' - init-steps: *common-js-init-steps From 67117a0bd52b259fc7c2b782d9f017adc17d6a3c Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 8 Jul 2026 23:28:50 +0200 Subject: [PATCH 5/5] cache bust --- nx.json | 1 + 1 file changed, 1 insertion(+) diff --git a/nx.json b/nx.json index 0e6a1879..37d98d81 100644 --- a/nx.json +++ b/nx.json @@ -1,4 +1,5 @@ { + "buest": "agent-test-1", "$schema": "./node_modules/nx/schemas/nx-schema.json", "defaultBase": "main", "nxCloudId": "69c71b9038eed5e74d5da8e4",