Skip to content
Merged
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
22 changes: 16 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,24 @@ jobs:
!contains(needs.*.result, 'failure')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.TOKEN_RELEASE_BOT }}

- name: Restore cache
uses: ./.github/actions/cache
with:
job: cts

- name: Push generated code to generated branch
id: pushGeneratedCode
if: github.event_name == 'pull_request'
run: yarn workspace scripts pushGeneratedCode
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GENERATE_BOT }}
PR_NUMBER: ${{ github.event.number }}

- name: Check JavaScript client size
run: exit $(yarn workspace algoliasearch-client-javascript test:size | echo $?)

Expand All @@ -385,7 +397,7 @@ jobs:
- name: Run
run: yarn cli cts run

codegen:
codegen_on_main:
runs-on: ubuntu-20.04
timeout-minutes: 10
needs:
Expand All @@ -394,6 +406,7 @@ jobs:
- client_javascript_algoliasearch
if: |
always() &&
github.event_name == 'refs/heads/main' &&
needs.setup.outputs.RUN_CODEGEN == 'true' &&
needs.cts.result == 'success'
steps:
Expand All @@ -408,17 +421,14 @@ jobs:
with:
job: codegen

- name: Push generated code
- name: Push generated code to main
id: pushGeneratedCode
run: yarn workspace scripts pushGeneratedCode
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GENERATE_BOT }}
PR_NUMBER: ${{ github.event.number }}

- name: Spread generation to each repository
if: |
steps.pushGeneratedCode.exitcode == 0 &&
github.ref == 'refs/heads/main'
if: steps.pushGeneratedCode.exitcode == 0
run: yarn workspace scripts spreadGeneration
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_RELEASE_BOT }}