1
1
name : CI
2
2
3
3
on : [ push, pull_request ]
4
+
4
5
env :
5
- LATEST_NODE : ' 14 '
6
+ DEFAULT_NODE : ' 16 '
6
7
7
8
jobs :
8
9
lockfile-lint :
9
10
name : Lockfile lint
10
- runs-on : ubuntu-latest
11
+ runs-on : ' ubuntu-latest'
11
12
steps :
12
13
- uses : actions/checkout@v2
13
14
- uses : actions/setup-node@v2
14
15
with :
15
- node-version : ${{ env.LATEST_NODE }}
16
+ node-version : ${{ env.DEFAULT_NODE }}
16
17
- name : lint lock file
17
- run : npx lockfile-lint --path package-lock.json --allowed-hosts npm --validate-https
18
-
18
+ run : npx lockfile-lint --path package-lock.json --allowed-hosts npm --validate-http
19
+
19
20
test :
20
21
strategy :
21
22
matrix :
22
23
platform : [ ubuntu-latest ]
23
- node : [ '10', '12', '14' ]
24
+ node : [ '10', '12', '14', '16' ]
24
25
name : Unit Tests Node ${{ matrix.node }} (${{ matrix.platform }})
25
26
needs : lockfile-lint
26
27
runs-on : ${{ matrix.platform }}
@@ -31,42 +32,44 @@ jobs:
31
32
node-version : ${{ matrix.node }}
32
33
- name : install dependencies
33
34
run : npm ci
34
- - name : lint
35
- run : npm run lint
36
- - name : units tests
35
+ - name : unit tests
37
36
run : npm run test:coverage
38
- - name : Coveralls
37
+ - name : upload code coverage artifacts
38
+ if : ${{ matrix.node == env.DEFAULT_NODE }}
39
+ uses : actions/upload-artifact@v2
40
+ with :
41
+ name : coverage
42
+ path : coverage
43
+
44
+ coverage :
45
+ needs : [test, lockfile-lint]
46
+ runs-on : ' ubuntu-latest'
47
+ steps :
48
+ - uses : actions/checkout@v2
49
+ - uses : actions/setup-node@v2
50
+ with :
51
+ node-version : ${{ env.DEFAULT_NODE }}
52
+ - name : install dependencies
53
+ run : npm ci
54
+ - name : download code coverage artifacts
55
+ uses : actions/download-artifact@v2
56
+ with :
57
+ name : coverage
58
+ path : coverage
59
+ - name : publish coverage to coveralls
39
60
uses : coverallsapp/github-action@master
40
- if : matrix.node == ${{ env.LATEST_NODE }}
41
61
with :
42
62
github-token : ${{ secrets.GITHUB_TOKEN }}
43
63
44
-
45
- release :
46
- name : release
47
- permissions :
48
- actions : write
49
- checks : write
50
- contents : write
51
- deployments : write
52
- issues : write
53
- packages : write
54
- pull-requests : write
55
- repository-projects : write
56
- security-events : write
57
- statuses : write
58
- needs : [ test, lockfile-lint ]
59
- runs-on : ubuntu-latest
60
- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
64
+ lint :
65
+ needs : lockfile-lint
66
+ runs-on : ' ubuntu-latest'
61
67
steps :
62
68
- uses : actions/checkout@v2
63
69
- uses : actions/setup-node@v2
64
70
with :
65
- node-version : ' 14 '
71
+ node-version : ${{ env.DEFAULT_NODE }}
66
72
- name : install dependencies
67
- run : npm ci --ignore-scripts
68
- - name : release
69
- run : npx semantic-release
70
- env :
71
- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
72
- NPM_TOKEN : ${{secrets.NPM_TOKEN}}
73
+ run : npm ci
74
+ - name : lint
75
+ run : npm run lint
0 commit comments