@@ -45,12 +45,10 @@ jobs:
4545 uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
4646 with :
4747 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 }}
5452 - name : Setup AWS credentials
5553 uses : aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
5654 with :
@@ -95,36 +93,16 @@ jobs:
9593 with :
9694 # Always use version 18
9795 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
10098 - name : " Configure AWS credentials"
10199 uses : aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
102100 with :
103101 role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
104102 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
125103 - name : Create layer files
126104 run : |
127105 export VERSION=latest
128106 bash .github/scripts/setup_tmp_layer_files.sh
129107 - 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