2024-12-28 22:36:50 +00:00
|
|
|
name: Run tests and upload coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Run tests and collect coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Set up Node
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 'latest'
|
|
|
|
|
|
|
|
- name: Configure Corepack
|
|
|
|
run: corepack enable
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: yarn coverage
|
|
|
|
|
2024-12-29 23:50:54 +00:00
|
|
|
- name: Generate junit.xml
|
|
|
|
run: JEST_JUNIT_CLASSNAME=\"{filepath}\" jest --reporters=jest-junit
|
|
|
|
|
2024-12-28 22:36:50 +00:00
|
|
|
- name: Upload results to Codecov
|
|
|
|
uses: codecov/codecov-action@v5
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2024-12-29 23:50:54 +00:00
|
|
|
|
|
|
|
- name: Upload junit.xml to Codecov
|
|
|
|
if: ${{ !cancelled() }}
|
|
|
|
uses: codecov/test-results-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|