feat: use only installed Node.js - no installation
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.
This commit is contained in:
@@ -19,9 +19,10 @@ jobs:
|
|||||||
test-cli-level1:
|
test-cli-level1:
|
||||||
runs-on: debian
|
runs-on: debian
|
||||||
|
|
||||||
strategy:
|
# strategy:
|
||||||
matrix:
|
# matrix:
|
||||||
node-version: [20, 24]
|
# node-version: [20, 24]
|
||||||
|
# Using installed Node.js version only
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Nuclear fix - absolute path control
|
- name: Nuclear fix - absolute path control
|
||||||
@@ -49,23 +50,16 @@ jobs:
|
|||||||
echo "✅ Node.js project detected!"
|
echo "✅ Node.js project detected!"
|
||||||
echo "=== NODE.JS SETUP ==="
|
echo "=== NODE.JS SETUP ==="
|
||||||
echo "Current Node.js version: $(node -v)"
|
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
|
# Verify Node.js is available
|
||||||
if [[ "${{ matrix.node-version }}" == "24" ]]; then
|
if ! command -v node >/dev/null 2>&1; then
|
||||||
echo "✅ Node.js 24 already installed and current"
|
echo "❌ Node.js not found - please install Node.js first"
|
||||||
echo "Skipping installation - using existing Node.js 24.13.0"
|
exit 1
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "✅ Node.js $(node -v) is available and ready"
|
||||||
|
|
||||||
echo "=== NPM INSTALL ==="
|
echo "=== NPM INSTALL ==="
|
||||||
npm install --legacy-peer-deps
|
npm install --legacy-peer-deps
|
||||||
|
|
||||||
@@ -141,7 +135,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload coverage reports
|
- name: Upload coverage reports
|
||||||
if: matrix.node-version == '24'
|
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gitea-runner/cli-workspace/repo
|
cd /opt/gitea-runner/cli-workspace/repo
|
||||||
if [ -f "package.json" ]; then
|
if [ -f "package.json" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user