Split out the dev checks into multiple jobs, the benefit of this is that it will be easier to see which check is failing and why.
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
push:
|
|
branches: [ "main" ]
|
|
merge_group:
|
|
|
|
# this prevents multiple jobs from the same pr
|
|
# running when new changes are pushed.
|
|
concurrency:
|
|
group: ${{github.workflow}}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
unit-tests:
|
|
name: Service Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run unit tests
|
|
run: npm run test:coverage
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./coverage/junit.xml
|
|
verbose: true
|
|
|
|
cockpit-unit-tests:
|
|
name: Cockpit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run unit tests with cockpit
|
|
run: npm run test:cockpit
|