@@ -155,14 +155,15 @@ jobs:
155
155
uses : ./.github/actions/setup
156
156
with :
157
157
type : minimal
158
+ language : javascript
158
159
159
160
- name : Build '${{ matrix.client }}' client
160
161
if : ${{ steps.cache.outputs.cache-hit != 'true' }}
161
- run : yarn workspace algoliasearch-client-javascript build ${{ matrix.client }}
162
+ run : cd clients/ algoliasearch-client-javascript yarn build ${{ matrix.client }}
162
163
163
164
- name : Run tests for 'client-common'
164
165
if : ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client == 'client-common' }}
165
- run : yarn workspace @experimental-api-clients-automation/client-common test
166
+ run : cd clients/algoliasearch-client-javascript && yarn workspace @experimental-api-clients-automation/client-common test
166
167
167
168
- name : Store '${{ matrix.client }}' JavaScript utils package
168
169
uses : actions/upload-artifact@v3
@@ -211,11 +212,17 @@ jobs:
211
212
212
213
- name : Setup
213
214
uses : ./.github/actions/setup
215
+ with :
216
+ language : ${{ matrix.client.language }}
214
217
215
218
- name : Generate clients
216
219
if : ${{ steps.cache.outputs.cache-hit != 'true' }}
217
220
run : yarn cli generate ${{ matrix.client.language }} ${{ matrix.client.toRun }}
218
221
222
+ - name : Update `yarn.lock` for JavaScript release
223
+ if : ${{ matrix.client.language == 'javascript' && (startsWith(github.head_ref, 'chore/prepare-release-') || github.ref == 'refs/heads/main') }}
224
+ run : YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
225
+
219
226
- name : Build clients
220
227
if : ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language != 'php' }}
221
228
run : yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toBuild }}
@@ -226,17 +233,34 @@ jobs:
226
233
227
234
- name : Run JavaScript 'algoliasearch' client tests
228
235
if : ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language == 'javascript' }}
229
- run : yarn workspace @experimental-api-clients-automation/algoliasearch test
236
+ run : cd clients/algoliasearch-client-javascript && yarn workspace @experimental-api-clients-automation/algoliasearch test
230
237
231
238
- name : Clean CTS output before generate
232
239
run : rm -rf ${{ matrix.client.testsToDelete }} || true
233
240
234
241
- name : Generate CTS
235
242
run : yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }}
236
243
237
- - name : Update `yarn.lock` for JavaScript release
238
- if : ${{ matrix.client.language == 'javascript' && (startsWith(github.head_ref, 'chore/prepare-release-') || github.ref == 'refs/heads/main') }}
239
- run : YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
244
+ # JavaScript test deps (needs to be cached because they are huge and inefficient)
245
+ - name : Get yarn js test cache directory path
246
+ if : ${{ matrix.client.language == 'javascript' }}
247
+ shell : bash
248
+ id : yarn-cache-dir
249
+ run : echo "::set-output name=dir::$(cd tests/output/javascript && yarn config get cacheFolder)"
250
+
251
+ - name : Restore Yarn js tests
252
+ if : ${{ matrix.client.language == 'javascript' }}
253
+ uses : actions/cache@v3
254
+ with :
255
+ path : ${{ steps.yarn-cache-dir.outputs.dir || 'tests/output/javascript/.yarn/cache' }}
256
+ key : yarn-cache-tests-${{ env.CACHE_VERSION }}-${{ hashFiles('tests/output/javascript/yarn.lock') }}
257
+
258
+ - name : Cache js-client node modules
259
+ if : ${{ matrix.client.language == 'javascript' }}
260
+ uses : actions/cache@v3
261
+ with :
262
+ path : tests/output/javascript/node_modules
263
+ key : node-modules-tests-${{ env.CACHE_VERSION }}-${{ hashFiles('tests/output/javascript/yarn.lock') }}
240
264
241
265
- name : Run CTS
242
266
run : yarn cli cts run ${{ matrix.client.language }}
0 commit comments