3.1.1 #58
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 14.x, 16.x, 18.x, 20.x, 22.x ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.JS ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
check-latest: true | |
- name: Print npm and Node.JS versions | |
run: node -v && npm -v | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Run linter | |
run: npm run lint | |
- name: Run tests with coverage | |
uses: paambaati/codeclimate-action@v9 | |
env: | |
CC_TEST_REPORTER_ID: 8c570151987d2d735f6aa1ea8d79629d30dfbcd18251218528454e93aebb0b2d | |
with: | |
coverageCommand: npm run coverage # Seems that when a test fails also the coverage fails, so we can do two steps with one. |