1 | name: ci
|
2 |
|
3 | on: [push, pull_request]
|
4 |
|
5 | jobs:
|
6 | should-skip:
|
7 | continue-on-error: true
|
8 | runs-on: ubuntu-latest
|
9 |
|
10 | outputs:
|
11 | should-skip-job: ${{steps.skip-check.outputs.should_skip}}
|
12 | steps:
|
13 | - id: skip-check
|
14 | uses: fkirc/skip-duplicate-actions@v2.1.0
|
15 | with:
|
16 | github_token: ${{github.token}}
|
17 |
|
18 | ci:
|
19 | needs: should-skip
|
20 |
|
21 | if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'}}
|
22 | strategy:
|
23 | fail-fast: false
|
24 | matrix:
|
25 | os: [ubuntu-latest, windows-latest, macos-latest]
|
26 | node: [12, 14, 16]
|
27 | runs-on: ${{matrix.os}}
|
28 | steps:
|
29 |
|
30 | - name: checkout code
|
31 | uses: actions/checkout@v2
|
32 |
|
33 | - name: setup node
|
34 | uses: actions/setup-node@v2
|
35 | with:
|
36 | node-version: '${{matrix.node}}'
|
37 | cache: npm
|
38 |
|
39 |
|
40 | - run: echo "::remove-matcher owner=eslint-compact::"
|
41 | - run: echo "::remove-matcher owner=eslint-stylish::"
|
42 | - run: echo "::remove-matcher owner=tsc::"
|
43 |
|
44 | - name: npm install
|
45 | run: npm i --prefer-offline --no-audit
|
46 |
|
47 | - name: run npm test
|
48 | run: npm run test
|
49 |
|
50 | - name: coverage
|
51 | uses: codecov/codecov-action@v1
|
52 | with:
|
53 | token: ${{secrets.CODECOV_TOKEN}}
|
54 | files: './coverage/coverage-final.json'
|
55 | fail_ci_if_error: true
|