Skip to content

Add package-lock.json for GitHub Actions caching #2

Add package-lock.json for GitHub Actions caching

Add package-lock.json for GitHub Actions caching #2

Workflow file for this run

name: Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run tests with coverage
run: npm run test:coverage
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false