From 4de57a4d9f0a349d1ac219951a74d0fe15100be6 Mon Sep 17 00:00:00 2001 From: Rizwan Date: Tue, 24 Mar 2026 01:42:50 +0530 Subject: [PATCH] Update node.js.yml --- .github/workflows/node.js.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 8253e5d..a69a156 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,32 +15,32 @@ jobs: node-version: [18.x, 20.x, 22.x] steps: + # Checkout the repository - uses: actions/checkout@v4 + # Setup Node.js and cache npm dependencies - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + cache: 'npm' - - name: Cache npm dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{ matrix.node-version }}- - + # Install dependencies cleanly - name: Install dependencies run: npm ci + # Build the project (if a build script exists) - name: Build project run: npm run build --if-present + # Run tests - name: Run tests run: npm test + # Optional check step (if you have a script named "check") - name: Run checks - run: npm run check || echo 'No check script found, skipping.' + run: npm run check || echo "No check script found, skipping." + # Feedback/logging step - name: Feedback - run: echo '✅ Node.js ${{ matrix.node-version }}: CI workflow completed successfully.' + run: echo ✅ Node.js ${{ matrix.node-version }}: CI workflow completed successfully."