.github/workflows/ci.yml
# save as ./github/workflows/git-ci-build.yml
# make sure that 'test-coverage' generates the coverage reports (lcov)
name: CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x, 18.x, 16.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run test
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/*.info:lcov
${{github.workspace}}/coverage/clover.xml:clover