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