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 : ' 18 '
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 }}
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,16 +44,16 @@ 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') }}
@@ -71,16 +67,16 @@ jobs:
71
67
runs-on : ubuntu-latest
72
68
steps :
73
69
- name : checkout
74
- uses : actions/checkout@master
70
+ uses : actions/checkout@v4
75
71
76
72
- name : restore cache from package-lock.json
77
- uses : actions/cache@v2
73
+ uses : actions/cache@v4
78
74
with :
79
75
path : package-temp-dir
80
76
key : lock-${{ github.sha }}
81
77
82
78
- name : restore cache from node_modules
83
- uses : actions/cache@v2
79
+ uses : actions/cache@v4
84
80
with :
85
81
path : node_modules
86
82
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -94,21 +90,26 @@ jobs:
94
90
runs-on : ubuntu-latest
95
91
steps :
96
92
- name : checkout
97
- uses : actions/checkout@master
93
+ uses : actions/checkout@v4
98
94
99
95
- name : restore cache from package-lock.json
100
- uses : actions/cache@v2
96
+ uses : actions/cache@v4
101
97
with :
102
98
path : package-temp-dir
103
99
key : lock-${{ github.sha }}
104
100
105
101
- name : restore cache from node_modules
106
- uses : actions/cache@v2
102
+ uses : actions/cache@v4
107
103
with :
108
104
path : node_modules
109
105
key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110
106
111
107
- name : coverage
112
- 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 }}
113
114
114
115
needs : setup
0 commit comments