Skip to content

Commit b1fdda2

Browse files
authored
chore(ci): run mac ci in parrallel (#3344)
1 parent c75edb6 commit b1fdda2

File tree

2 files changed

+44
-21
lines changed

2 files changed

+44
-21
lines changed

.github/workflows/check.yml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ jobs:
349349
- client_gen
350350
if: |
351351
always() &&
352+
needs.setup.outputs.RUN_GEN == 'true' &&
352353
needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' &&
353354
!contains(needs.*.result, 'cancelled') &&
354355
!contains(needs.*.result, 'failure')
@@ -412,8 +413,6 @@ jobs:
412413
- setup
413414
- client_gen
414415
- client_gen_javascript
415-
- swift_cts_macos
416-
- kotlin_build_macos
417416
if: |
418417
always() &&
419418
!contains(needs.*.result, 'cancelled') &&
@@ -422,6 +421,7 @@ jobs:
422421
pull-requests: write
423422
outputs:
424423
success: ${{ steps.setoutput.outputs.success }}
424+
generatedCommit: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT || github.event.pull_request.head.ref }}
425425
steps:
426426
- uses: actions/checkout@v4
427427
with:
@@ -495,25 +495,6 @@ jobs:
495495
| 🍃 Generated commit | [`${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}) |
496496
| 🌲 Generated branch | [`generated/${{ github.head_ref }}`](${{ github.event.pull_request.base.repo.html_url }}/tree/generated/${{ github.head_ref }}) |
497497
498-
- name: Spread generation to each repository
499-
id: spreadGeneration
500-
if: github.ref == 'refs/heads/main'
501-
run: yarn workspace scripts spreadGeneration
502-
env:
503-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
504-
505-
- name: Wait for all release CI
506-
if: github.ref == 'refs/heads/main'
507-
run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }}
508-
env:
509-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
510-
511-
- name: Push specs to algolia documentation
512-
if: github.ref == 'refs/heads/main'
513-
run: yarn workspace scripts pushToAlgoliaDoc
514-
env:
515-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
516-
517498
- name: Set output
518499
id: setoutput
519500
run: echo "success=true" >> "$GITHUB_OUTPUT"
@@ -523,10 +504,50 @@ jobs:
523504
timeout-minutes: 10
524505
needs:
525506
- codegen
507+
- swift_cts_macos
508+
- kotlin_build_macos
526509
if: always()
527510
steps:
528511
- run: |
529512
if [[ "${{ needs.codegen.outputs.success }}" != "true" ]]; then
530513
echo "codegen step didn't succeed"
531514
exit 1
532515
fi
516+
517+
push_and_release:
518+
runs-on: ubuntu-22.04
519+
timeout-minutes: 15
520+
needs:
521+
- codegen
522+
- check_green
523+
if: github.ref == 'refs/heads/main'
524+
permissions:
525+
pull-requests: write
526+
steps:
527+
- uses: actions/checkout@v4
528+
with:
529+
fetch-depth: 0
530+
ref: ${{ needs.codegen.outputs.generatedCommit }}
531+
token: ${{ secrets.ALGOLIA_BOT_TOKEN }}
532+
repository: ${{ github.event.pull_request.head.repo.full_name }}
533+
534+
- name: Setup
535+
uses: ./.github/actions/setup
536+
with:
537+
type: minimal
538+
539+
- name: Spread generation to each repository
540+
id: spreadGeneration
541+
run: yarn workspace scripts spreadGeneration
542+
env:
543+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
544+
545+
- name: Wait for all release CI
546+
run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }}
547+
env:
548+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
549+
550+
- name: Push specs to algolia documentation
551+
run: yarn workspace scripts pushToAlgoliaDoc
552+
env:
553+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

scripts/ci/codegen/waitForAllReleases.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ async function waitForAllReleases(languagesReleased: Language[]): Promise<void>
5151
const lastCommitMessage = await run('git log -1 --format="%s"');
5252

5353
if (!lastCommitMessage.startsWith(commitStartRelease)) {
54+
console.log('No release commit found, skipping waiting for CI');
55+
5456
return;
5557
}
5658

0 commit comments

Comments
 (0)