Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): forgot the no codegen message #482

Merged
merged 3 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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