mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 23:04:02 +02:00
It's a first step to add code coverage. In order to get the code coverage report locally, you can run the following command: ```bash npx gulp unittestcli --coverage ``` The code coverage report will be generated in the `./build/coverage` directory. And the report can be consulted by opening: http://localhost:8888/build/coverage/index.html A GitHub workflow has also been added to run the unit tests with code coverage on each push and pull request. The report will be uploaded to Codecov.
42 lines
946 B
YAML
42 lines
946 B
YAML
name: Code Coverage
|
|
on: [push, pull_request]
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [lts/*]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run CLI unit tests with code coverage
|
|
run: npx gulp unittestcli --coverage
|
|
|
|
- name: Upload results to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: true
|
|
files: ./build/coverage/lcov.info
|
|
flags: unittestcli
|
|
name: codecov-umbrella
|
|
verbose: true
|