File tree 2 files changed +32
-5
lines changed
2 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,33 @@ jobs:
15
15
id : cacheModules
16
16
uses : actions/cache@v4
17
17
with :
18
- path : ~/.npm # this is cache where npm installs from before going out to the network
18
+ path : ~/.npm # this is the cache where npm installs from before going out to the network
19
19
key : ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
20
20
- name : Install dependencies
21
21
if : steps.cacheModules.outputs.cache-hit != 'true'
22
22
run : npm install
23
23
24
+ build :
25
+ name : Build
26
+ needs : [install]
27
+ runs-on : ubuntu-latest
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+ - name : Restore node_modules
31
+ uses : actions/cache@v4
32
+ with :
33
+ path : ~/.npm # this is the cache where npm installs from before going out to the network
34
+ key : ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
35
+ - name : Cache dist
36
+ id : cacheDist
37
+ uses : actions/cache@v4
38
+ with :
39
+ path : ./dist
40
+ key : ${{ runner.os }}-node-${{ hashFiles('package.json', 'rollup.config.js', 'src/*.js') }}
41
+ - name : Build cross-fetch
42
+ if : steps.cacheDist.outputs.cache-hit != 'true'
43
+ run : make dist
44
+
24
45
debug :
25
46
name : Debug
26
47
runs-on : ubuntu-latest
29
50
30
51
checks :
31
52
name : Check
32
- needs : [install ]
53
+ needs : [build ]
33
54
uses : ./.github/workflows/checks.yml
34
55
with :
35
56
ref : ${{ github.sha }}
@@ -38,13 +59,13 @@ jobs:
38
59
# Github doesn't pass down the SNYK_TOKEN environment variable.
39
60
security :
40
61
name : Check Security
41
- needs : [install ]
62
+ needs : [build ]
42
63
runs-on : ubuntu-latest
43
64
steps :
44
65
- uses : actions/checkout@v4
45
66
- uses : actions/cache@v4
46
67
with :
47
- path : ~/.npm # this is cache where npm installs from before going out to the network
68
+ path : ~/.npm # this is the cache where npm installs from before going out to the network
48
69
key : ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
49
70
- run : npm install --prefer-offline
50
71
- run : make secure
Original file line number Diff line number Diff line change @@ -22,10 +22,16 @@ jobs:
22
22
- uses : actions/checkout@v4
23
23
with :
24
24
ref : ${{ inputs.ref }}
25
- - uses : actions/cache@v4
25
+ - name : Restore node modules
26
+ uses : actions/cache@v4
26
27
with :
27
28
path : ~/.npm # this is cache where npm installs from before going out to the network
28
29
key : ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
30
+ - name : Restore dist
31
+ uses : actions/cache@v4
32
+ with :
33
+ path : ./dist
34
+ key : ${{ runner.os }}-node-${{ hashFiles('package.json', 'rollup.config.js', 'src/*.js') }}
29
35
- name : Use Node.js ${{ matrix.node-version }}
30
36
uses : actions/setup-node@v4
31
37
with :
You can’t perform that action at this time.
0 commit comments