11name : CI
22
3- on :
4- push :
5- branches : [ master ]
6- pull_request :
7- branches : [ master ]
3+ on : ['push', 'pull_request']
84
95jobs :
106 setup :
117 runs-on : ubuntu-latest
128 steps :
139 - name : checkout
14- uses : actions/checkout@master
10+ uses : actions/checkout@v4
1511
16- - uses : actions/setup-node@v1
12+ - uses : actions/setup-node@v4
1713 with :
18- node-version : ' 12 '
14+ node-version : ' 20 '
1915
2016 - name : cache package-lock.json
21- uses : actions/cache@v2
17+ uses : actions/cache@v4
2218 with :
2319 path : package-temp-dir
2420 key : lock-${{ github.sha }}
2521
2622 - name : create package-lock.json
27- run : npm i --package-lock-only
23+ run : npm i --package-lock-only --ignore-scripts --legacy-peer-deps
2824
2925 - name : hack for singe file
3026 run : |
@@ -35,78 +31,85 @@ jobs:
3531
3632 - name : cache node_modules
3733 id : node_modules_cache_id
38- uses : actions/cache@v2
34+ uses : actions/cache@v4
3935 with :
4036 path : node_modules
4137 key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
4238
4339 - name : install
4440 if : steps.node_modules_cache_id.outputs.cache-hit != 'true'
45- run : npm ci
46-
41+ run : npm ci --legacy-peer-deps
42+
4743 lint :
4844 runs-on : ubuntu-latest
49- needs : setup
5045 steps :
5146 - name : checkout
52- uses : actions/checkout@master
47+ uses : actions/checkout@v4
5348
5449 - name : restore cache from package-lock.json
55- uses : actions/cache@v2
50+ uses : actions/cache@v4
5651 with :
5752 path : package-temp-dir
5853 key : lock-${{ github.sha }}
5954
6055 - name : restore cache from node_modules
61- uses : actions/cache@v2
56+ uses : actions/cache@v4
6257 with :
6358 path : node_modules
6459 key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
6560
6661 - name : lint
6762 run : npm run lint
6863
69-
64+ needs : setup
65+
7066 compile :
7167 runs-on : ubuntu-latest
72- needs : setup
7368 steps :
7469 - name : checkout
75- uses : actions/checkout@master
70+ uses : actions/checkout@v4
7671
7772 - name : restore cache from package-lock.json
78- uses : actions/cache@v2
73+ uses : actions/cache@v4
7974 with :
8075 path : package-temp-dir
8176 key : lock-${{ github.sha }}
8277
8378 - name : restore cache from node_modules
84- uses : actions/cache@v2
79+ uses : actions/cache@v4
8580 with :
8681 path : node_modules
8782 key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
8883
8984 - name : compile
9085 run : npm run compile
91-
86+
87+ needs : setup
88+
9289 coverage :
9390 runs-on : ubuntu-latest
94- needs : setup
9591 steps :
9692 - name : checkout
97- uses : actions/checkout@master
93+ uses : actions/checkout@v4
9894
9995 - name : restore cache from package-lock.json
100- uses : actions/cache@v2
96+ uses : actions/cache@v4
10197 with :
10298 path : package-temp-dir
10399 key : lock-${{ github.sha }}
104100
105101 - name : restore cache from node_modules
106- uses : actions/cache@v2
102+ uses : actions/cache@v4
107103 with :
108104 path : node_modules
109105 key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110106
111107 - name : coverage
112- 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 }}
114+
115+ needs : setup
0 commit comments