Skip to content

Commit

Permalink
fix(ci): forgot the no codegen message (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored May 9, 2022
1 parent 3d62612 commit 89e2b2f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
16 changes: 10 additions & 6 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,23 @@ runs:
if: inputs.type == 'matrix'
id: gen-matrix
shell: bash
run: yarn workspace scripts createMatrix ${{ steps.diff.outputs.ORIGIN_BRANCH }} clients

- name: Check if JavaScript utils should run
if: inputs.type == 'matrix'
id: js-utils
shell: bash
run: |
if [[ ${{ steps.diff.outputs.JS_ALGOLIASEARCH_CHANGED }} > 0 ]]; then
if [[ ${{ steps.gen-matrix.outputs.RUN_GEN_JAVASCRIPT || steps.diff.outputs.JS_ALGOLIASEARCH_CHANGED > 0 }} ]]; then
echo "Running algoliasearch: true"
echo "::set-output name=RUN_JS_ALGOLIASEARCH::true"
fi
if [[ ${{ steps.diff.outputs.JS_UTILS_CHANGED }} > 0 ]]; then
if [[ ${{ steps.gen-matrix.outputs.RUN_GEN_JAVASCRIPT || steps.diff.outputs.JS_UTILS_CHANGED > 0 }} ]]; then
echo "Running JavaScript utils: true"
echo "::set-output name=RUN_JS_UTILS::true"
fi
yarn workspace scripts createMatrix ${{ steps.diff.outputs.ORIGIN_BRANCH }} clients
outputs:
RUN_SCRIPTS:
description: Determine if the `scripts` job should run
Expand All @@ -120,10 +124,10 @@ outputs:

RUN_JS_ALGOLIASEARCH:
description: Determine if the `client-javascript-algoliasearch` job should run
value: ${{ steps.gen-matrix.outputs.RUN_JS_ALGOLIASEARCH }}
value: ${{ steps.js-utils.outputs.RUN_JS_ALGOLIASEARCH }}
RUN_JS_UTILS:
description: Whether to build JS client common folders when RUN_JS is false
value: ${{ steps.gen-matrix.outputs.RUN_JS_UTILS }}
value: ${{ steps.js-utils.outputs.RUN_JS_UTILS }}
RUN_JS_TESTS:
description: Determine if the `client_javascript_tests` job should run
value: ${{ steps.diff.outputs.JS_COMMON_TESTS_CHANGED > 0 }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ jobs:
- client_gen
if: |
always() &&
needs.setup.outputs.RUN_CODEGEN == 'true' &&
github.event_name == 'pull_request' &&
!contains(needs.*.result, 'cancelled') &&
!contains(needs.*.result, 'failure')
Expand All @@ -311,16 +310,17 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.TOKEN_GENERATE_BOT }}

- name: Download all artifacts
uses: ./.github/actions/restore-artifacts
with:
type: all

- name: Setup
uses: ./.github/actions/setup
with:
type: minimal

- name: Download all artifacts
if: ${{ needs.setup.outputs.RUN_CODEGEN == 'true' }}
uses: ./.github/actions/restore-artifacts
with:
type: all

- name: Push generated code to generated branch
id: pushGeneratedCode
run: yarn workspace scripts pushGeneratedCode
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/githubActions/createMatrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async function getClientMatrix(baseBranch: string): Promise<void> {
continue;
}

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

0 comments on commit 89e2b2f

Please sign in to comment.