@@ -12,25 +12,48 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
steps :
14
14
- uses : actions/checkout@v4
15
+
16
+ # Reference: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
17
+ - name : Cache node modules
18
+ id : cache-npm
19
+ uses : actions/cache@v4.0.2
20
+ env :
21
+ cache-name : cache-node-modules
22
+ with :
23
+ # npm cache files are stored in `~/.npm` on Linux/macOS
24
+ path : ~/.npm
25
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26
+ restore-keys : |
27
+ ${{ runner.os }}-build-${{ env.cache-name }}-
28
+ ${{ runner.os }}-build-
29
+ ${{ runner.os }}-
30
+
31
+ - if : ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
32
+ name : List the state of node modules
33
+ continue-on-error : true
34
+ run : npm list
35
+
15
36
- uses : actions/setup-node@v3
16
37
with :
17
- node-version : 16 # TODO: extract this to strategy.matrix, reference: https://github.com/orgs/community/discussions/26284#discussioncomment-3251198
38
+ # TODO: extract this to strategy.matrix, reference: https://github.com/orgs/community/discussions/26284#discussioncomment-3251198
39
+ node-version : 16
40
+
18
41
- run : npm ci
19
42
- run : npm test
20
43
21
- # publish-npm:
22
- # needs: build
23
- # runs-on: ubuntu-latest
24
- # steps:
25
- # - uses: actions/checkout@v4
26
- # - uses: actions/setup-node@v3
27
- # with:
28
- # node-version: 16
29
- # registry-url: https://registry.npmjs.org/
30
- # - run: npm ci
31
- # - run: npm publish
32
- # env:
33
- # NODE_AUTH_TOKEN: ${{secrets.npm_token}}
44
+ # publish-npm:
45
+ # needs: build
46
+ # runs-on: ubuntu-latest
47
+ # steps:
48
+ # - uses: actions/checkout@v4
49
+ # - uses: actions/setup-node@v3
50
+ # with:
51
+ # node-version: 16
52
+ # registry-url: https://registry.npmjs.org/
53
+ # - run: npm ci
54
+ # - run: npm publish
55
+ # env:
56
+ # NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34
57
35
58
publish-gpr :
36
59
needs : build
0 commit comments