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

chore(ci): run mac ci in parrallel #3344

Merged
merged 4 commits into from
Jul 10, 2024
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
63 changes: 42 additions & 21 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ jobs:
- client_gen
if: |
always() &&
needs.setup.outputs.RUN_GEN == 'true' &&
needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' &&
!contains(needs.*.result, 'cancelled') &&
!contains(needs.*.result, 'failure')
Expand Down Expand Up @@ -412,8 +413,6 @@ jobs:
- setup
- client_gen
- client_gen_javascript
- swift_cts_macos
- kotlin_build_macos
if: |
always() &&
!contains(needs.*.result, 'cancelled') &&
Expand All @@ -422,6 +421,7 @@ jobs:
pull-requests: write
outputs:
success: ${{ steps.setoutput.outputs.success }}
generatedCommit: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT || github.event.pull_request.head.ref }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -495,25 +495,6 @@ jobs:
| 🍃 Generated commit | [`${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}) |
| 🌲 Generated branch | [`generated/${{ github.head_ref }}`](${{ github.event.pull_request.base.repo.html_url }}/tree/generated/${{ github.head_ref }}) |

- name: Spread generation to each repository
id: spreadGeneration
if: github.ref == 'refs/heads/main'
run: yarn workspace scripts spreadGeneration
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

- name: Wait for all release CI
if: github.ref == 'refs/heads/main'
run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }}
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

- name: Push specs to algolia documentation
if: github.ref == 'refs/heads/main'
run: yarn workspace scripts pushToAlgoliaDoc
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

- name: Set output
id: setoutput
run: echo "success=true" >> "$GITHUB_OUTPUT"
Expand All @@ -523,10 +504,50 @@ jobs:
timeout-minutes: 10
needs:
- codegen
- swift_cts_macos
- kotlin_build_macos
if: always()
steps:
- run: |
if [[ "${{ needs.codegen.outputs.success }}" != "true" ]]; then
echo "codegen step didn't succeed"
exit 1
fi

push_and_release:
runs-on: ubuntu-22.04
timeout-minutes: 15
needs:
- codegen
- check_green
if: github.ref == 'refs/heads/main'
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.codegen.outputs.generatedCommit }}
token: ${{ secrets.ALGOLIA_BOT_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

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

- name: Spread generation to each repository
id: spreadGeneration
run: yarn workspace scripts spreadGeneration
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

- name: Wait for all release CI
run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }}
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

- name: Push specs to algolia documentation
run: yarn workspace scripts pushToAlgoliaDoc
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
2 changes: 2 additions & 0 deletions scripts/ci/codegen/waitForAllReleases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ async function waitForAllReleases(languagesReleased: Language[]): Promise<void>
const lastCommitMessage = await run('git log -1 --format="%s"');

if (!lastCommitMessage.startsWith(commitStartRelease)) {
console.log('No release commit found, skipping waiting for CI');

return;
}

Expand Down
Loading