chore: npm audit fix (#91) #132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Basic CI | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- '*' | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- 'CODE_OF_CONDUCT.md' | |
- 'CONTRIBUTING.md' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
node-version: [ 18.x, 20.x, 22.x ] | |
os: [ ubuntu-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Use 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: Build | |
run: npm run build | |
- name: Tests | |
run: npm run test | |
code-coverage: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint-ci | |
- name: Generate code coverage report | |
run: npm run test-coverage | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |