@@ -45,12 +45,10 @@ jobs:
45
45
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
46
46
with :
47
47
node-version : ${{ matrix.version }}
48
- - name : Setup npm
49
- run : npm i -g npm@next-8
50
- - name : Install dependencies
51
- # This installs all the dependencies of ./packages/*
52
- # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
53
- run : npm ci --foreground-scripts
48
+ - name : Setup dependencies
49
+ uses : ./.github/actions/cached-node-modules
50
+ with :
51
+ nodeVersion : ${{ matrix.version }}
54
52
- name : Setup AWS credentials
55
53
uses : aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
56
54
with :
@@ -95,36 +93,16 @@ jobs:
95
93
with :
96
94
# Always use version 18
97
95
node-version : 18
98
- - name : Setup npm
99
- run : npm i -g npm@next-8
96
+ - name : Setup dependencies
97
+ uses : ./.github/actions/cached-node-modules
100
98
- name : " Configure AWS credentials"
101
99
uses : aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
102
100
with :
103
101
role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
104
102
aws-region : eu-west-1
105
- - name : Cache node modules for commons
106
- id : cache-node-modules
107
- uses : actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
108
- with :
109
- path : " ./node_modules"
110
- # Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
111
- # if one of them changes the cache is invalidated/discarded
112
- key : ${{ matrix.version }}-cache-utilities-node-modules-${{ hashFiles('./package-lock.json') }}
113
- - name : Install dependencies
114
- # We can skip the install if there was a cache hit
115
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
116
- # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
117
- run : npm ci --foreground-scripts
118
- - name : Build packages
119
- # If there's a cache hit we still need to manually build the packages
120
- # this would otherwise have been done automatically as a part of the
121
- # postinstall npm hook
122
- if : steps.cache-node-modules.outputs.cache-hit == 'true'
123
- run : |
124
- npm run build -w packages/commons
125
103
- name : Create layer files
126
104
run : |
127
105
export VERSION=latest
128
106
bash .github/scripts/setup_tmp_layer_files.sh
129
107
- name : Run integration test on layers
130
- run : RUNTIME=nodejs${{ matrix.version }}. x npm run test:e2e -w layers
108
+ run : RUNTIME=nodejs${{ matrix.version }}x npm run test:e2e -w layers
0 commit comments