From 5247349d33bf51867a28fb32bb794beb56d1d9e4 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Wed, 8 Jul 2026 16:06:35 +0100 Subject: [PATCH] Fix CI: pin Node 24 and install frontend deps with npm ci CI ran `yarn && yarn dev` with no committed yarn.lock, so every run resolved the latest matching versions and dependency drift broke the pipeline in two independent ways: - select2 4.1.0 added engines.node ">=24" but the runner used node 22, so `yarn install` failed outright on every pull request. - webpack 5.108 removed lib/SizeFormatHelpers, which laravel-mix 6 still requires, so `yarn dev` would have failed the build regardless of node. Switch the workflow to `npm ci`, which installs the exact, known-good versions already pinned in package-lock.json (select2 4.0.13, webpack 5.100.1) and is verified to build and lint cleanly. Pin the runner to node 24 via actions/setup-node so the toolchain is explicit rather than tracking the runner default. Also pin select2 to ~4.0.13 in package.json so a future `npm install` cannot pull the incompatible 4.1.0 back in. --- .github/workflows/ci.yml | 14 +++++++------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cd601692..80ac6e4b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,17 +31,17 @@ jobs: cp .env.example .env php artisan key:generate - - name: Cache yarn dependencies - uses: actions/cache@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - path: node_modules - key: yarn-${{ hashFiles('yarn.lock') }} + node-version: '24' + cache: 'npm' - - name: Run yarn - run: yarn && yarn dev + - name: Install node modules and build assets + run: npm ci && npm run dev - name: Run ESLint - run: yarn lint + run: npm run lint - name: Run tests run: php artisan test diff --git a/package-lock.json b/package-lock.json index 47176653c..698780519 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "select2": "^4.0.13", + "select2": "~4.0.13", "sortablejs": "^1.15.0" }, "devDependencies": { diff --git a/package.json b/package.json index 00d8b8974..533f19534 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "webpack-cli": "^6.0.1" }, "dependencies": { - "select2": "^4.0.13", + "select2": "~4.0.13", "sortablejs": "^1.15.0" } }