From 00eb19a8d345ebc36761ebf52b3ea85b4f332843 Mon Sep 17 00:00:00 2001 From: Maximilian Noller Date: Tue, 14 Apr 2026 02:24:21 +0200 Subject: [PATCH 1/2] refactor: split unit-tests into parallel lint + test jobs, add setup-node-workspace action --- .../actions/setup-node-workspace/action.yml | 24 +++++++++ .github/workflows/ci.yml | 52 ++++++++----------- 2 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 .github/actions/setup-node-workspace/action.yml diff --git a/.github/actions/setup-node-workspace/action.yml b/.github/actions/setup-node-workspace/action.yml new file mode 100644 index 00000000..802884cb --- /dev/null +++ b/.github/actions/setup-node-workspace/action.yml @@ -0,0 +1,24 @@ +name: Setup Node.js workspace +description: Set up Node.js with npm cache, install root and container dependencies. + +inputs: + node-version: + description: Node.js version to use. + default: '22' + +runs: + using: composite + steps: + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: ${{ inputs.node-version }} + cache: npm + + - name: Install root dependencies + shell: bash + run: npm install + + - name: Install container dependencies + shell: bash + run: npm run setup diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76d30bc4..3891c2a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: branches: - main +concurrency: + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + permissions: contents: write @@ -46,14 +50,8 @@ jobs: cache-from: type=gha,scope=${{ matrix.name }}-preflight cache-to: type=gha,mode=max,scope=${{ matrix.name }}-preflight - - name: Setup Node.js (e2e) - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: 22 - cache: npm - - - name: Install test dependencies (e2e) - run: npm install + - name: Setup Node.js workspace + uses: ./.github/actions/setup-node-workspace - name: Gateway e2e tests (local, no API key) if: matrix.name == 'gateway' @@ -77,23 +75,14 @@ jobs: HYBRIDCLAW_E2E_AGENT_IMAGE: hybridclaw-agent:preflight run: npx vitest run --config vitest.e2e.config.ts tests/agent-container.e2e.test.ts - unit-tests: + lint: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm install - - - name: Install container dependencies - run: npm run setup + - name: Setup Node.js workspace + uses: ./.github/actions/setup-node-workspace - name: Biome check (changed files) shell: bash @@ -139,6 +128,17 @@ jobs: - name: TypeScript lint (console) run: npm --prefix console run typecheck + test: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Setup Node.js workspace + uses: ./.github/actions/setup-node-workspace + - name: Build release artifacts run: npm run build @@ -183,20 +183,14 @@ jobs: keep_files: true npm-e2e: - needs: unit-tests + needs: test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm install + - name: Setup Node.js workspace + uses: ./.github/actions/setup-node-workspace - name: Build release artifacts run: npm run build From 7a7d3cb20348d148d2a4fcca4bf08df2bbea4cf1 Mon Sep 17 00:00:00 2001 From: Maximilian Noller Date: Tue, 14 Apr 2026 04:47:49 +0200 Subject: [PATCH 2/2] chore: use npm ci in composite action, align publish-release to Node 22 with npm cache --- .github/actions/setup-node-workspace/action.yml | 2 +- .github/workflows/publish-release.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-node-workspace/action.yml b/.github/actions/setup-node-workspace/action.yml index 802884cb..b53906e9 100644 --- a/.github/actions/setup-node-workspace/action.yml +++ b/.github/actions/setup-node-workspace/action.yml @@ -17,7 +17,7 @@ runs: - name: Install root dependencies shell: bash - run: npm install + run: npm ci - name: Install container dependencies shell: bash diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 75b2a434..1d2c0220 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -250,7 +250,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: - node-version: 24 + node-version: 22 + cache: npm - name: Install dependencies run: npm ci