upgrade node to v20 #26
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: Quality check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: 19.x | |
- run: node -p process.versions | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
unit-tests: | |
name: Unit tests | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node-version: [18.x, 19.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: ${{ matrix.node-version }} | |
- run: node -p process.versions | |
- name: Install dependencies | |
run: npm ci | |
- name: Run unit tests | |
run: npm test | |
coverage: | |
name: Report coverage | |
env: | |
CC_TEST_REPORTER_ID: a2d82974a4532d427b8855175de07eabef6bba36a8025d3c346a3ead1be33141 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: 19.x | |
- run: node -p process.versions | |
- name: Install dependencies | |
run: npm ci | |
- name: Set up CodeClimate reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
chmod +x ./cc-test-reporter | |
- name: Run unit tests and report | |
run: | | |
./cc-test-reporter before-build | |
npm test -- --coverage | |
EXIT_CODE=$? | |
mv ./packages/coverage/clover.xml ./clover.xml | |
./cc-test-reporter after-build -t clover --exit-code $EXIT_CODE | |
audit: | |
name: Audit dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: 19.x | |
- run: node -p process.versions | |
- name: Install dependencies | |
run: npm ci | |
- name: Audit dependencies | |
run: npm audit |