-
Notifications
You must be signed in to change notification settings - Fork 781
39 lines (33 loc) · 1.13 KB
/
coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Code coverage
on:
- push
jobs:
run:
name: Code coverage
if: ${{ github.repository == 'qunitjs/qunit' }} # skip on forks, needs secret
runs-on: ubuntu-20.04
env:
PUPPETEER_CACHE_DIR: "${{ github.workspace }}/.puppeteer_download"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18.x
- run: npm install
- name: Tests
run: npm run coverage
- name: Upload to coveralls.io
if: ${{ github.ref_name == 'main' }} # skip upload on non-main branches
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.2/php-coveralls.phar
chmod +x php-coveralls.phar
./php-coveralls.phar -v --coverage_clover coverage/clover.xml --json_path coverage/coveralls.json