chore: update nodejs to 20.x #15
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: Node CI | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [18.x, 20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Project setup `npm ci` | |
run: npm ci | |
- name: Run `test` | |
run: npm test | |
coverage: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Project setup `npm ci` | |
run: npm ci | |
- name: Run `coverage` | |
run: npm run coverage | |
- name: Export `coverage` | |
env: | |
NODE_COVERALLS_DEBUG: 0 | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
COVERALLS_GIT_COMMIT: ${{ github.sha }} | |
COVERALLS_GIT_BRANCH: ${{ github.ref }} | |
run: | | |
npm install coveralls | |
cat coverage/lcov.info | ./node_modules/.bin/coveralls | |
- name: Upload `coverage` artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: coverage/lcov-report | |
stryker: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Project setup `npm ci` | |
run: npm ci | |
- name: Run `stryker` | |
run: npm run stryker | |
- name: Upload `stryker` artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: stryker | |
path: reports/mutation/html | |
publish: | |
needs: [test, coverage] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.ref == 'refs/heads/master' | |
- uses: actions/setup-node@v4 | |
if: github.ref == 'refs/heads/master' | |
with: | |
node-version: 20.x | |
- name: Project setup `npm ci && npm run build` | |
if: github.ref == 'refs/heads/master' | |
run: | | |
npm ci | |
npm run build --if-present | |
env: | |
CI: true | |
- name: Run `publish` | |
if: github.ref == 'refs/heads/master' | |
run: npm run publish --if-present |