@@ -3,62 +3,72 @@ name: ci
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
+ should-skip :
7
+ continue-on-error : true
8
+ runs-on : ubuntu-latest
9
+ # Map a step output to a job output
10
+ outputs :
11
+ should-skip-job : ${{steps.skip-check.outputs.should_skip}}
12
+ steps :
13
+ - id : skip-check
14
+
15
+ with :
16
+ github_token : ${{github.token}}
17
+
6
18
ci :
7
- env :
8
- BROWSER_STACK_USERNAME : ${{ secrets.BROWSER_STACK_USERNAME }}
9
- BROWSER_STACK_ACCESS_KEY : ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
10
- runs-on : ${{ matrix.os }}
19
+ needs : should-skip
20
+ if : ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}}
11
21
strategy :
12
- # TODO: test IE 11, Legacy Edge, and New Edge on windows-latest
13
- # test Safari on macos-latest
22
+ fail-fast : false
14
23
matrix :
15
24
os : [ubuntu-latest]
16
-
25
+ test-type : ['unit']
26
+ env :
27
+ BROWSER_STACK_USERNAME : ${{secrets.BROWSER_STACK_USERNAME}}
28
+ BROWSER_STACK_ACCESS_KEY : ${{secrets.BROWSER_STACK_ACCESS_KEY}}
29
+ CI_TEST_TYPE : ${{matrix.test-type}}
30
+ runs-on : ${{matrix.os}}
17
31
steps :
18
- - uses : actions/checkout@v2
19
- - name : Cache dependencies
20
- uses : actions/cache@v2
21
- with :
22
- path : |
23
- ~/.npm
24
- **/node_modules
25
- key : ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
26
- restore-keys : |
27
- ${{ runner.os }}-npm-
28
- ${{ runner.os }}-
32
+ - name : checkout code
33
+ uses : actions/checkout@v2
29
34
30
- - name : Read .nvmrc
35
+ - name : read node version from .nvmrc
31
36
run : echo ::set-output name=NVMRC::$(cat .nvmrc)
32
37
shell : bash
33
38
id : nvm
34
39
35
- - name : Install ffmpeg/pulseaudio for firefox on linux w/o browserstack
40
+ - name : update apt cache on linux w/o browserstack
41
+ run : sudo apt-get update
42
+
43
+ - name : install ffmpeg/pulseaudio for firefox on linux w/o browserstack
36
44
run : sudo apt-get install ffmpeg pulseaudio
37
- if : ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}
38
45
39
46
- name : start pulseaudio for firefox on linux w/o browserstack
40
47
run : pulseaudio -D
41
- if : ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}
42
48
43
- - name : Setup node
44
- uses : actions/setup-node@v1
49
+ - name : setup node
50
+ uses : actions/setup-node@v2
45
51
with :
46
- node-version : ' ${{ steps.nvm.outputs.NVMRC }}'
47
- - run : npm i --prefer-offline --no-audit
52
+ node-version : ' ${{steps.nvm.outputs.NVMRC}}'
53
+ cache : npm
48
54
49
- # run safari on macos
50
- - name : Run Mac test
51
- run : npm run test -- --browsers Safari
52
- if : ${{ startsWith(matrix.os, 'macos') }}
55
+ # turn off the default setup-node problem watchers...
56
+ - run : echo "::remove-matcher owner=eslint-compact::"
57
+ - run : echo "::remove-matcher owner=eslint-stylish::"
58
+ - run : echo "::remove-matcher owner=tsc::"
53
59
54
- # only run ie 11 on windows
55
- - name : Run Windows test
56
- run : npm run test -- --browsers IE
57
- if : ${{ startsWith(matrix.os, 'windows') }}
60
+ - name : npm install
61
+ run : npm i --prefer-offline --no-audit
58
62
59
- # run chrome/firefox or browserstack in linux
60
- - name : Run linux test
63
+ - name : run npm test
61
64
uses : GabrielBB/xvfb-action@v1
62
65
with :
63
- run : npm test
64
- if : ${{ startsWith(matrix.os, 'ubuntu') }}
66
+ run : npm run test
67
+
68
+ - name : coverage
69
+ uses : codecov/codecov-action@v1
70
+ with :
71
+ token : ${{secrets.CODECOV_TOKEN}}
72
+ files : ' ./test/dist/coverage/coverage-final.json'
73
+ fail_ci_if_error : true
74
+ if : ${{startsWith(env.CI_TEST_TYPE, 'coverage')}}
0 commit comments