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 : |
35
31
36
32
- name : cache node_modules
37
33
id : node_modules_cache_id
38
- uses : actions/cache@v2
34
+ uses : actions/cache@v4
39
35
with :
40
36
path : node_modules
41
37
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -48,42 +44,39 @@ jobs:
48
44
runs-on : ubuntu-latest
49
45
steps :
50
46
- name : checkout
51
- uses : actions/checkout@master
47
+ uses : actions/checkout@v4
52
48
53
49
- name : restore cache from package-lock.json
54
- uses : actions/cache@v2
50
+ uses : actions/cache@v4
55
51
with :
56
52
path : package-temp-dir
57
53
key : lock-${{ github.sha }}
58
54
59
55
- name : restore cache from node_modules
60
- uses : actions/cache@v2
56
+ uses : actions/cache@v4
61
57
with :
62
58
path : node_modules
63
59
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
64
60
65
61
- name : lint
66
62
run : npm run lint
67
63
68
- - name : type:check
69
- run : npm run type:check
70
-
71
64
needs : setup
72
65
73
66
compile :
74
67
runs-on : ubuntu-latest
75
68
steps :
76
69
- name : checkout
77
- uses : actions/checkout@master
70
+ uses : actions/checkout@v4
78
71
79
72
- name : restore cache from package-lock.json
80
- uses : actions/cache@v2
73
+ uses : actions/cache@v4
81
74
with :
82
75
path : package-temp-dir
83
76
key : lock-${{ github.sha }}
84
77
85
78
- name : restore cache from node_modules
86
- uses : actions/cache@v2
79
+ uses : actions/cache@v4
87
80
with :
88
81
path : node_modules
89
82
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -97,21 +90,26 @@ jobs:
97
90
runs-on : ubuntu-latest
98
91
steps :
99
92
- name : checkout
100
- uses : actions/checkout@master
93
+ uses : actions/checkout@v4
101
94
102
95
- name : restore cache from package-lock.json
103
- uses : actions/cache@v2
96
+ uses : actions/cache@v4
104
97
with :
105
98
path : package-temp-dir
106
99
key : lock-${{ github.sha }}
107
100
108
101
- name : restore cache from node_modules
109
- uses : actions/cache@v2
102
+ uses : actions/cache@v4
110
103
with :
111
104
path : node_modules
112
105
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
113
106
114
107
- name : coverage
115
- 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 }}
116
114
117
115
needs : setup
0 commit comments