1
1
name : CI
2
2
3
- on :
4
- push :
5
- branches : [master]
6
- pull_request :
7
- branches : [master]
3
+ on : ['push', 'pull_request']
8
4
9
5
jobs :
10
6
setup :
11
7
runs-on : ubuntu-latest
12
8
steps :
13
9
- name : checkout
14
- uses : actions/checkout@master
10
+ uses : actions/checkout@v4
15
11
16
- - uses : actions/setup-node@v1
12
+ - uses : actions/setup-node@v4
17
13
with :
18
- node-version : ' 12 '
14
+ node-version : ' 20 '
19
15
20
16
- name : cache package-lock.json
21
- uses : actions/cache@v2
17
+ uses : actions/cache@v4
22
18
with :
23
19
path : package-temp-dir
24
20
key : lock-${{ github.sha }}
25
21
26
22
- name : create package-lock.json
27
- run : npm i --package-lock-only
23
+ run : npm i --package-lock-only --ignore-scripts
28
24
29
25
- name : hack for singe file
30
26
run : |
31
27
if [ ! -d "package-temp-dir" ]; then
32
28
mkdir package-temp-dir
33
29
fi
34
30
cp package-lock.json package-temp-dir
31
+
35
32
- name : cache node_modules
36
33
id : node_modules_cache_id
37
- uses : actions/cache@v2
34
+ uses : actions/cache@v4
38
35
with :
39
36
path : node_modules
40
37
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -47,16 +44,16 @@ jobs:
47
44
runs-on : ubuntu-latest
48
45
steps :
49
46
- name : checkout
50
- uses : actions/checkout@master
47
+ uses : actions/checkout@v4
51
48
52
49
- name : restore cache from package-lock.json
53
- uses : actions/cache@v2
50
+ uses : actions/cache@v4
54
51
with :
55
52
path : package-temp-dir
56
53
key : lock-${{ github.sha }}
57
54
58
55
- name : restore cache from node_modules
59
- uses : actions/cache@v2
56
+ uses : actions/cache@v4
60
57
with :
61
58
path : node_modules
62
59
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -70,16 +67,16 @@ jobs:
70
67
runs-on : ubuntu-latest
71
68
steps :
72
69
- name : checkout
73
- uses : actions/checkout@master
70
+ uses : actions/checkout@v4
74
71
75
72
- name : restore cache from package-lock.json
76
- uses : actions/cache@v2
73
+ uses : actions/cache@v4
77
74
with :
78
75
path : package-temp-dir
79
76
key : lock-${{ github.sha }}
80
77
81
78
- name : restore cache from node_modules
82
- uses : actions/cache@v2
79
+ uses : actions/cache@v4
83
80
with :
84
81
path : node_modules
85
82
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -93,21 +90,26 @@ jobs:
93
90
runs-on : ubuntu-latest
94
91
steps :
95
92
- name : checkout
96
- uses : actions/checkout@master
93
+ uses : actions/checkout@v4
97
94
98
95
- name : restore cache from package-lock.json
99
- uses : actions/cache@v2
96
+ uses : actions/cache@v4
100
97
with :
101
98
path : package-temp-dir
102
99
key : lock-${{ github.sha }}
103
100
104
101
- name : restore cache from node_modules
105
- uses : actions/cache@v2
102
+ uses : actions/cache@v4
106
103
with :
107
104
path : node_modules
108
105
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
109
106
110
107
- name : coverage
111
- run : npm run coverage && bash <(curl -s https://codecov.io/bash)
108
+ run : npm test -- --coverage
109
+
110
+ - name : Upload coverage to Codecov
111
+ uses : codecov/codecov-action@v4
112
+ with :
113
+ token : ${{ secrets.CODECOV_TOKEN }}
112
114
113
115
needs : setup
0 commit comments