52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: JS Tests
|
|
on: pull_request
|
|
|
|
jobs:
|
|
jest:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [20]
|
|
npm-version: [9]
|
|
|
|
name: node${{ matrix.node-version }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
|
|
|
- name: Set up node ${{ matrix.node-version }}
|
|
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Set up npm ${{ matrix.npm-version }}
|
|
run: npm i -g npm@${{ matrix.npm-version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Test
|
|
run: npm run test:coverage
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: ./coverage/coverage-final.json
|
|
flags: javascript
|
|
fail_ci_if_error: true
|
|
|
|
summary:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- jest
|
|
|
|
if: always()
|
|
|
|
name: npm-test-summary
|
|
|
|
steps:
|
|
- name: Jest status
|
|
run: if ${{ needs.jest.result != 'success' && needs.jest.result != 'skipped' }}; then exit 1; fi
|