From e739f6aaff1348d6255ed19a26bc0b498f373cad Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 1 Mar 2026 17:54:36 -0800 Subject: [PATCH] fix: check Node.js version, not just presence, in CI The Act runner has Node.js v18 pre-installed, so the check `command -v node` passes and skips installing v22. Node 18 is too old for dependencies like vitest, jsdom, and tailwindcss/oxide. Now checks the major version and upgrades if < 22. Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/build-app.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build-app.yml b/.gitea/workflows/build-app.yml index b093403..b7f8fc1 100644 --- a/.gitea/workflows/build-app.yml +++ b/.gitea/workflows/build-app.yml @@ -20,12 +20,21 @@ jobs: build-linux: runs-on: ubuntu-latest steps: - - name: Install Node.js + - name: Install Node.js 22 run: | + NEED_INSTALL=false if command -v node >/dev/null 2>&1; then - echo "Node.js already installed: $(node --version)" + NODE_MAJOR=$(node --version | sed 's/v\([0-9]*\).*/\1/') + echo "Found Node.js $(node --version) (major: ${NODE_MAJOR})" + if [ "$NODE_MAJOR" -lt 22 ]; then + echo "Node.js ${NODE_MAJOR} is too old, upgrading to 22..." + NEED_INSTALL=true + fi else - echo "Installing Node.js 22..." + echo "Node.js not found, installing 22..." + NEED_INSTALL=true + fi + if [ "$NEED_INSTALL" = true ]; then curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt-get install -y nodejs fi @@ -140,12 +149,21 @@ jobs: build-macos: runs-on: macos-latest steps: - - name: Install Node.js + - name: Install Node.js 22 run: | + NEED_INSTALL=false if command -v node >/dev/null 2>&1; then - echo "Node.js already installed: $(node --version)" + NODE_MAJOR=$(node --version | sed 's/v\([0-9]*\).*/\1/') + echo "Found Node.js $(node --version) (major: ${NODE_MAJOR})" + if [ "$NODE_MAJOR" -lt 22 ]; then + echo "Node.js ${NODE_MAJOR} is too old, upgrading to 22..." + NEED_INSTALL=true + fi else - echo "Installing Node.js 22 via Homebrew..." + echo "Node.js not found, installing 22..." + NEED_INSTALL=true + fi + if [ "$NEED_INSTALL" = true ]; then brew install node@22 brew link --overwrite node@22 fi