Skip to content

Commit e167a36

Browse files
committed
test run without CLI
1 parent aa5abeb commit e167a36

File tree

6 files changed

+42
-33
lines changed

6 files changed

+42
-33
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222

223223
- name: Build clients
224224
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language != 'php' }}
225-
run: yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toRun }}
225+
run: ${{ matrix.client.buildCommand }}
226226

227227
- name: Test JavaScript bundle size
228228
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language == 'javascript' && startsWith(env.head_ref, 'chore/prepare-release-') }}

clients/algoliasearch-client-javascript/scripts/build_all.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

clients/algoliasearch-client-javascript/yarn.lock

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ __metadata:
1313
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
1414
"@algolia/requester-node-http": 5.0.0-alpha.5
1515
"@types/node": 16.11.47
16-
rollup: 2.77.0
16+
rollup: 2.77.2
1717
typescript: 4.7.4
1818
languageName: unknown
1919
linkType: soft
@@ -26,7 +26,7 @@ __metadata:
2626
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
2727
"@algolia/requester-node-http": 5.0.0-alpha.5
2828
"@types/node": 16.11.47
29-
rollup: 2.77.0
29+
rollup: 2.77.2
3030
typescript: 4.7.4
3131
languageName: unknown
3232
linkType: soft
@@ -52,7 +52,7 @@ __metadata:
5252
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
5353
"@algolia/requester-node-http": 5.0.0-alpha.5
5454
"@types/node": 16.11.47
55-
rollup: 2.77.0
55+
rollup: 2.77.2
5656
typescript: 4.7.4
5757
languageName: unknown
5858
linkType: soft
@@ -65,7 +65,7 @@ __metadata:
6565
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
6666
"@algolia/requester-node-http": 5.0.0-alpha.5
6767
"@types/node": 16.11.47
68-
rollup: 2.77.0
68+
rollup: 2.77.2
6969
typescript: 4.7.4
7070
languageName: unknown
7171
linkType: soft
@@ -78,7 +78,7 @@ __metadata:
7878
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
7979
"@algolia/requester-node-http": 5.0.0-alpha.5
8080
"@types/node": 16.11.47
81-
rollup: 2.77.0
81+
rollup: 2.77.2
8282
typescript: 4.7.4
8383
languageName: unknown
8484
linkType: soft
@@ -91,7 +91,7 @@ __metadata:
9191
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
9292
"@algolia/requester-node-http": 5.0.0-alpha.5
9393
"@types/node": 16.11.47
94-
rollup: 2.77.0
94+
rollup: 2.77.2
9595
typescript: 4.7.4
9696
languageName: unknown
9797
linkType: soft
@@ -104,7 +104,7 @@ __metadata:
104104
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
105105
"@algolia/requester-node-http": 5.0.0-alpha.5
106106
"@types/node": 16.11.47
107-
rollup: 2.77.0
107+
rollup: 2.77.2
108108
typescript: 4.7.4
109109
languageName: unknown
110110
linkType: soft
@@ -117,7 +117,7 @@ __metadata:
117117
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
118118
"@algolia/requester-node-http": 5.0.0-alpha.5
119119
"@types/node": 16.11.47
120-
rollup: 2.77.0
120+
rollup: 2.77.2
121121
typescript: 4.7.4
122122
languageName: unknown
123123
linkType: soft
@@ -130,7 +130,7 @@ __metadata:
130130
"@algolia/requester-browser-xhr": 5.0.0-alpha.5
131131
"@algolia/requester-node-http": 5.0.0-alpha.5
132132
"@types/node": 16.11.47
133-
rollup: 2.77.0
133+
rollup: 2.77.2
134134
typescript: 4.7.4
135135
languageName: unknown
136136
linkType: soft
@@ -3830,7 +3830,7 @@ __metadata:
38303830
"@types/jest": 28.1.6
38313831
"@types/node": 16.11.47
38323832
jest: 28.1.3
3833-
rollup: 2.77.0
3833+
rollup: 2.77.2
38343834
ts-jest: 28.0.7
38353835
typescript: 4.7.4
38363836
languageName: unknown
@@ -9068,20 +9068,6 @@ __metadata:
90689068
languageName: node
90699069
linkType: hard
90709070

9071-
"rollup@npm:2.77.0":
9072-
version: 2.77.0
9073-
resolution: "rollup@npm:2.77.0"
9074-
dependencies:
9075-
fsevents: ~2.3.2
9076-
dependenciesMeta:
9077-
fsevents:
9078-
optional: true
9079-
bin:
9080-
rollup: dist/bin/rollup
9081-
checksum: 74ccc98429709984a89af636250833e7502d87f1d9c6d96ebfe4b52030ebf94b9f6b84b8ab476670329a61d54b681d35eecdc601bac5b5396b099b1ea69970ef
9082-
languageName: node
9083-
linkType: hard
9084-
90859071
"rollup@npm:2.77.2":
90869072
version: 2.77.2
90879073
resolution: "rollup@npm:2.77.2"

scripts/ci/githubActions/createMatrix.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/* eslint-disable no-console */
1+
/* eslint-disable no-console,no-case-declarations */
22
import { CLIENTS, createClientName, GENERATORS, LANGUAGES } from '../../common';
33
import {
4+
getClientsConfigField,
45
getLanguageFolder,
56
getTestExtension,
67
getTestOutputFolder,
@@ -99,19 +100,42 @@ async function getClientMatrix(baseBranch: string): Promise<void> {
99100
return `${testsOutputBase}/client/${clientName}${extension} ${testsOutputBase}/methods/requests/${clientName}${extension}`;
100101
})
101102
.join(' ');
103+
const toRun = matrix[language].toRun.join(' ');
104+
let buildCommand = `yarn cli build clients ${language} ${toRun}`;
102105

103106
switch (language) {
104107
case 'java':
105108
testsToStore = `${testsToStore} ${testsRootFolder}/build.gradle`;
106109
break;
110+
// The CI runs on a node docker image, therefore it's not needed to run via the CLI
111+
case 'javascript':
112+
const packages = matrix[language].toRun.map((client) => {
113+
const packageName =
114+
GENERATORS[`${language}-${client}`].additionalProperties
115+
.packageName;
116+
117+
// `algoliasearch` is not preceded by `@algolia`
118+
return client === 'algoliasearch'
119+
? packageName
120+
: `${getClientsConfigField(
121+
'javascript',
122+
'npmNamespace'
123+
)}/${packageName}`;
124+
});
125+
126+
buildCommand = `cd ${
127+
matrix[language].path
128+
} && yarn build:many '{${packages.join(',')}}'`;
129+
break;
107130
default:
108131
break;
109132
}
110133

111134
clientMatrix.client.push({
112135
language,
113136
path: matrix[language].path,
114-
toRun: matrix[language].toRun.join(' '),
137+
toRun,
138+
buildCommand,
115139
cacheKey: await computeCacheKey(`clients-${language}`, [
116140
...matrix[language].cacheToCompute,
117141
'specs/common',

scripts/ci/githubActions/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export type ClientMatrix = BaseMatrix & {
2929
* The client language.
3030
*/
3131
language: string;
32+
/**
33+
* The command to build the clients.
34+
*/
35+
buildCommand: string;
3236
/**
3337
* The root of the test folder.
3438
*/

templates/javascript/clients/package.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"jest": "28.1.3",
103103
"ts-jest": "28.0.7",
104104
"typescript": "4.7.4",
105-
"rollup": "2.77.0"
105+
"rollup": "2.77.2"
106106
},
107107
{{/isAlgoliasearchClient}}
108108
"types": "index.d.ts",

0 commit comments

Comments
 (0)