-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (49 loc) · 1.64 KB
/
test.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Tests
on: [push, pull_request]
env:
CI: true
jobs:
test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [ 16, 18, 20, 21]
os: [ubuntu-latest, windows-latest]
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install npm dependencies
run: npm install # switch to `npm ci` when Node.js 6 support is dropped
- name: Run lint
run: npm run lint
- name: Run tests
run: npm run test-cov
- name: test token
run: echo "${{ secrets.COVERALLS_REPO_TOKEN }}"
- name: Coveralls
run: cat ./coverage/lcov.info | node ./bin/coveralls.js
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SERVICE_NAME: CI-pipeline
COVERALLS_SERVICE_JOB_ID: ${{github.run_id}}
COVERALLS_SERVICE_JOB_NUMBER: ${{github.run_number}}
COVERALLS_FLAG_NAME: ${{matrix.os}}-node-${{ matrix.node }}
COVERALLS_PARALLEL: true
NODE_COVERALLS_DEBUG: 1
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Coveralls Finished
run: |
curl -kv -d 'payload[build_num]=${{github.run_id}}&payload[status]=done' https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}