From 3c44d7a71f69cd54a7549c58d40aa00b92e6a8d6 Mon Sep 17 00:00:00 2001 From: aitbc1 Date: Fri, 27 Mar 2026 22:16:26 +0100 Subject: [PATCH] feat: use only installed Node.js - no installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NODE.JS OPTIMIZATION: Use existing installation only, no matrix Changes: ✅ Removed Node.js matrix (20, 24) - using single installed version ✅ Removed all Node.js installation logic ✅ Uses only installed Node.js 24.13.0 ✅ Simplified workflow - single job instead of matrix ✅ Updated coverage upload - no matrix condition Benefits: - Faster execution (no installation steps) - Uses production Node.js 24.13.0 directly - Simpler workflow configuration - No network requests for NodeSource scripts - Consistent testing environment - Reduced CI/CD execution time Rationale: - gitea-runner has Node.js 24.13.0 installed - No need to install additional versions - Focus on testing with actual production environment - Eliminate installation overhead and complexity This makes CLI testing much faster and simpler while using the exact Node.js version that's available in production. --- .gitea/workflows/cli-level1-tests.yml | 29 ++++++++++----------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/cli-level1-tests.yml b/.gitea/workflows/cli-level1-tests.yml index 5c10d249..ea70ac5f 100644 --- a/.gitea/workflows/cli-level1-tests.yml +++ b/.gitea/workflows/cli-level1-tests.yml @@ -19,9 +19,10 @@ jobs: test-cli-level1: runs-on: debian - strategy: - matrix: - node-version: [20, 24] + # strategy: +# matrix: +# node-version: [20, 24] +# Using installed Node.js version only steps: - name: Nuclear fix - absolute path control @@ -49,23 +50,16 @@ jobs: echo "✅ Node.js project detected!" echo "=== NODE.JS SETUP ===" echo "Current Node.js version: $(node -v)" - echo "Target Node.js version: ${{ matrix.node-version }}" + echo "Using installed Node.js version - no installation needed" - # Node.js version management - if [[ "${{ matrix.node-version }}" == "24" ]]; then - echo "✅ Node.js 24 already installed and current" - echo "Skipping installation - using existing Node.js 24.13.0" - elif [[ "${{ matrix.node-version }}" == "20" ]]; then - echo "Installing Node.js 20 LTS for stability testing..." - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - - apt-get install -y nodejs - echo "Node.js 20 installed: $(node -v)" - else - echo "Installing Node.js ${{ matrix.node-version }}..." - curl -fsSL https://deb.nodesource.com/setup_${{ matrix.node-version }}.x | bash - - apt-get install -y nodejs + # Verify Node.js is available + if ! command -v node >/dev/null 2>&1; then + echo "❌ Node.js not found - please install Node.js first" + exit 1 fi + echo "✅ Node.js $(node -v) is available and ready" + echo "=== NPM INSTALL ===" npm install --legacy-peer-deps @@ -141,7 +135,6 @@ jobs: fi - name: Upload coverage reports - if: matrix.node-version == '24' run: | cd /opt/gitea-runner/cli-workspace/repo if [ -f "package.json" ]; then