Skip to content

Commit 89e2b2f

Browse files
authored
fix(ci): forgot the no codegen message (#482)
1 parent 3d62612 commit 89e2b2f

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

.github/actions/setup/action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,23 @@ runs:
8686
if: inputs.type == 'matrix'
8787
id: gen-matrix
8888
shell: bash
89+
run: yarn workspace scripts createMatrix ${{ steps.diff.outputs.ORIGIN_BRANCH }} clients
90+
91+
- name: Check if JavaScript utils should run
92+
if: inputs.type == 'matrix'
93+
id: js-utils
94+
shell: bash
8995
run: |
90-
if [[ ${{ steps.diff.outputs.JS_ALGOLIASEARCH_CHANGED }} > 0 ]]; then
96+
if [[ ${{ steps.gen-matrix.outputs.RUN_GEN_JAVASCRIPT || steps.diff.outputs.JS_ALGOLIASEARCH_CHANGED > 0 }} ]]; then
9197
echo "Running algoliasearch: true"
9298
echo "::set-output name=RUN_JS_ALGOLIASEARCH::true"
9399
fi
94100
95-
if [[ ${{ steps.diff.outputs.JS_UTILS_CHANGED }} > 0 ]]; then
101+
if [[ ${{ steps.gen-matrix.outputs.RUN_GEN_JAVASCRIPT || steps.diff.outputs.JS_UTILS_CHANGED > 0 }} ]]; then
96102
echo "Running JavaScript utils: true"
97103
echo "::set-output name=RUN_JS_UTILS::true"
98104
fi
99105
100-
yarn workspace scripts createMatrix ${{ steps.diff.outputs.ORIGIN_BRANCH }} clients
101-
102106
outputs:
103107
RUN_SCRIPTS:
104108
description: Determine if the `scripts` job should run
@@ -120,10 +124,10 @@ outputs:
120124

121125
RUN_JS_ALGOLIASEARCH:
122126
description: Determine if the `client-javascript-algoliasearch` job should run
123-
value: ${{ steps.gen-matrix.outputs.RUN_JS_ALGOLIASEARCH }}
127+
value: ${{ steps.js-utils.outputs.RUN_JS_ALGOLIASEARCH }}
124128
RUN_JS_UTILS:
125129
description: Whether to build JS client common folders when RUN_JS is false
126-
value: ${{ steps.gen-matrix.outputs.RUN_JS_UTILS }}
130+
value: ${{ steps.js-utils.outputs.RUN_JS_UTILS }}
127131
RUN_JS_TESTS:
128132
description: Determine if the `client_javascript_tests` job should run
129133
value: ${{ steps.diff.outputs.JS_COMMON_TESTS_CHANGED > 0 }}

.github/workflows/check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ jobs:
300300
- client_gen
301301
if: |
302302
always() &&
303-
needs.setup.outputs.RUN_CODEGEN == 'true' &&
304303
github.event_name == 'pull_request' &&
305304
!contains(needs.*.result, 'cancelled') &&
306305
!contains(needs.*.result, 'failure')
@@ -311,16 +310,17 @@ jobs:
311310
ref: ${{ github.event.pull_request.head.ref }}
312311
token: ${{ secrets.TOKEN_GENERATE_BOT }}
313312

314-
- name: Download all artifacts
315-
uses: ./.github/actions/restore-artifacts
316-
with:
317-
type: all
318-
319313
- name: Setup
320314
uses: ./.github/actions/setup
321315
with:
322316
type: minimal
323317

318+
- name: Download all artifacts
319+
if: ${{ needs.setup.outputs.RUN_CODEGEN == 'true' }}
320+
uses: ./.github/actions/restore-artifacts
321+
with:
322+
type: all
323+
324324
- name: Push generated code to generated branch
325325
id: pushGeneratedCode
326326
run: yarn workspace scripts pushGeneratedCode

scripts/ci/githubActions/createMatrix.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ async function getClientMatrix(baseBranch: string): Promise<void> {
8282
continue;
8383
}
8484

85+
console.log(`::set-output name=RUN_GEN_${language.toUpperCase()}::true`);
8586
matrix[language].toRun.push(client);
8687
matrix[language].cacheToCompute.push(`specs/${bundledSpec}`);
8788
}

0 commit comments

Comments
 (0)