Skip to content

Optimize Node.js CI workflow - add timeout, cache npm #2

Optimize Node.js CI workflow - add timeout, cache npm

Optimize Node.js CI workflow - add timeout, cache npm #2

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint 2>/dev/null || echo "No lint script"
- name: Run tests
run: npm test 2>/dev/null || echo "No test script"
- name: Build
run: npm run build 2>/dev/null || echo "No build script"