name: Node.js CI on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' # Use Node.js version >= 18 cache: 'npm' - name: Install dependencies run: npm ci - name: Run npm audit fix (optional, to fix vulnerabilities) run: npm audit fix || echo "Some issues require manual fixing." - name: Lint and build run: | npm run lint # Ensure this script exists in your package.json npm run build # Ensure this script exists in your package.json - name: Run tests run: npm test