Skip to content

Commit 07fc74a

Browse files
jonphippsclaude
andcommitted
fix: simplify CI to avoid Nx Cloud distributed execution failures
- Remove distributed execution setup that was causing agent failures - Simplify to sequential execution of typecheck, lint, test, build - Remove agent configuration to avoid 'agents were stopped due to error' - Maintain parallel execution within each step for performance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2684e72 commit 07fc74a

File tree

1 file changed

+10
-55
lines changed

1 file changed

+10
-55
lines changed

.github/workflows/nx-optimized-ci.yml

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ on:
99
workflow_dispatch:
1010

1111
env:
12-
NX_CLOUD_DISTRIBUTED_EXECUTION: true
13-
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3
1412
NX_BRANCH: ${{ github.event.number || github.ref_name }}
1513
NX_RUN_GROUP: ${{ github.run_id }}
1614
HUSKY: 0
1715

1816
jobs:
19-
main:
20-
name: Nx Cloud - Main Job
17+
ci:
18+
name: CI Pipeline
2119
runs-on: ubuntu-latest
2220
steps:
2321
- name: Checkout [Pull Request]
@@ -50,58 +48,15 @@ jobs:
5048
- name: Install dependencies
5149
run: pnpm install --no-frozen-lockfile
5250

53-
- name: Start CI run
54-
run: 'npx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3'
51+
- name: Run type checking
52+
run: npx nx affected --target=typecheck --parallel=3
5553

56-
- name: Run commands in parallel
57-
run: |
58-
pids=()
59-
60-
# Type checking
61-
npx nx affected --target=typecheck --parallel=3 --verbose & pids+=($!)
62-
63-
# Linting
64-
npx nx affected --target=lint --parallel=3 --verbose & pids+=($!)
65-
66-
# Unit tests
67-
npx nx affected --target=test --parallel=3 --verbose & pids+=($!)
68-
69-
# Build affected projects
70-
npx nx affected --target=build --parallel=3 --verbose & pids+=($!)
71-
72-
# Wait for all jobs to complete
73-
for pid in "${pids[@]}"; do
74-
wait $pid
75-
done
54+
- name: Run linting
55+
run: npx nx affected --target=lint --parallel=3
7656

77-
- name: Stop all running agents for this CI run
78-
if: ${{ always() }}
79-
run: npx nx-cloud stop-all-agents
57+
- name: Run unit tests
58+
run: npx nx affected --target=test --parallel=3
8059

81-
agents:
82-
name: Nx Cloud - Agents
83-
runs-on: ubuntu-latest
84-
timeout-minutes: 60
85-
strategy:
86-
matrix:
87-
agent: [1, 2, 3]
88-
steps:
89-
- name: Checkout
90-
uses: actions/checkout@v4
91-
92-
- name: Setup pnpm
93-
uses: pnpm/action-setup@v4
94-
95-
- name: Setup Node.js
96-
uses: actions/setup-node@v4
97-
with:
98-
node-version: '22'
99-
cache: 'pnpm'
100-
101-
- name: Install dependencies
102-
run: pnpm install --no-frozen-lockfile
60+
- name: Build affected projects
61+
run: npx nx affected --target=build --parallel=3
10362

104-
- name: Start Nx Agent ${{ matrix.agent }}
105-
run: npx nx-cloud start-agent
106-
env:
107-
NX_AGENT_NAME: ${{ matrix.agent }}

0 commit comments

Comments
 (0)