10
10
- master
11
11
- next
12
12
13
+ permissions :
14
+ contents : read
15
+
13
16
jobs :
14
17
lint :
15
18
name : Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
@@ -20,87 +23,73 @@ jobs:
20
23
strategy :
21
24
matrix :
22
25
os : [ubuntu-latest]
23
- node-version : [12.x ]
26
+ node-version : [lts/* ]
24
27
25
28
runs-on : ${{ matrix.os }}
26
29
30
+ concurrency :
31
+ group : lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }}
32
+ cancel-in-progress : true
27
33
steps :
28
- - uses : actions/checkout@v2
34
+ - uses : actions/checkout@v3
29
35
with :
30
36
fetch-depth : 0
31
37
32
38
- name : Use Node.js ${{ matrix.node-version }}
33
- uses : actions/setup-node@v1
39
+ uses : actions/setup-node@v3
34
40
with :
35
41
node-version : ${{ matrix.node-version }}
36
-
37
- - name : Use latest NPM
38
- run : sudo npm i -g npm
42
+ cache : " npm"
39
43
40
44
- name : Install dependencies
41
45
run : npm ci
42
46
43
47
- name : Lint
44
48
run : npm run lint
45
49
50
+ - name : Build types
51
+ run : npm run build:types
52
+
53
+ - name : Check types
54
+ run : if [ -n "$(git status types --porcelain)" ]; then echo "Missing types. Update types by running 'npm run build:types'"; exit 1; else echo "All types are valid"; fi
55
+
46
56
- name : Security audit
47
57
run : npm run security
48
58
49
59
- name : Check commit message
50
- uses : wagoid/commitlint-github-action@v1
60
+ uses : wagoid/commitlint-github-action@v4
51
61
52
62
test :
53
63
name : Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
54
64
55
65
strategy :
56
66
matrix :
57
67
os : [ubuntu-latest, windows-latest, macos-latest]
58
- node-version : [12 .x, 14 .x, 16 .x]
59
- webpack-version : [4, latest]
68
+ node-version : [14 .x, 16 .x, 18.x, 19 .x]
69
+ webpack-version : [latest]
60
70
61
71
runs-on : ${{ matrix.os }}
62
72
73
+ concurrency :
74
+ group : test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ github.ref }}
75
+ cancel-in-progress : true
76
+
63
77
steps :
64
- - uses : actions/checkout@v2
78
+ - uses : actions/checkout@v3
65
79
66
80
- name : Use Node.js ${{ matrix.node-version }}
67
- uses : actions/setup-node@v1
81
+ uses : actions/setup-node@v3
68
82
with :
69
83
node-version : ${{ matrix.node-version }}
70
-
71
- - name : Use latest NPM on ubuntu/macos
72
- if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
73
- run : sudo npm i -g npm
74
-
75
- - name : Use latest NPM on windows
76
- if : matrix.os == 'windows-latest'
77
- run : npm i -g npm
78
-
79
- - name : Get npm cache directory
80
- id : npm-cache-dir
81
- run : |
82
- echo "::set-output name=dir::$(npm config get cache)"
83
-
84
- - name : Cache Node.js modules
85
- id : cache
86
- uses : actions/cache@v2
87
- with :
88
- path : ${{ steps.npm-cache-dir.outputs.dir }}
89
- key : ${{ runner.os }}-${{ matrix.webpack-version }}-node-${{ hashFiles('**/package-lock.json') }}
90
- restore-keys : |
91
- ${{ runner.os }}-${{ matrix.webpack-version }}-node-
84
+ cache : " npm"
92
85
93
86
- name : Install dependencies
94
87
run : npm ci
95
88
96
- - name : Install webpack ${{ matrix.webpack-version }}
97
- if : matrix.webpack-version == '4'
98
- run : npm i webpack@${{ matrix.webpack-version }}
99
-
100
89
- name : Run tests for webpack version ${{ matrix.webpack-version }}
101
90
run : npm run test:coverage -- --ci
102
91
103
92
- name : Submit coverage data to codecov
104
- uses : codecov/codecov-action@v1
93
+ uses : codecov/codecov-action@v3
105
94
with :
106
95
token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments