From b316e84f0debd944ff7b2d37b7f4918fabf4df4b Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Thu, 27 Feb 2025 05:36:41 +0530 Subject: [PATCH] - CI: serialize on whole workflow instead of individual jobs --- .../workflows/reusable-sidestore-build.yml | 26 ++++++++++++------- ...ore-serialize.yml => sidestore-shared.yml} | 13 +++------- 2 files changed, 20 insertions(+), 19 deletions(-) rename .github/workflows/{sidestore-serialize.yml => sidestore-shared.yml} (51%) diff --git a/.github/workflows/reusable-sidestore-build.yml b/.github/workflows/reusable-sidestore-build.yml index 073b1105..eb81fd69 100644 --- a/.github/workflows/reusable-sidestore-build.yml +++ b/.github/workflows/reusable-sidestore-build.yml @@ -44,43 +44,49 @@ on: BUILD_LOG_ZIP_PASSWORD: required: false + +# since build cache, test-build cache, test-run cache are involved, out of order exec if serialization is on individual jobs will wreak all sorts of havoc +# so we serialize on the entire workflow +concurrency: + group: serialize-workflow + jobs: - serialize: - uses: ./.github/workflows/sidestore-serialize.yml + shared: + uses: ./.github/workflows/sidestore-shared.yml secrets: inherit build: - needs: serialize + needs: shared uses: ./.github/workflows/sidestore-build.yml with: is_beta: ${{ inputs.is_beta }} is_shared_build_num: ${{ inputs.is_shared_build_num }} release_tag: ${{ inputs.release_tag }} - short_commit: ${{ needs.serialize.outputs.short-commit }} + short_commit: ${{ needs.shared.outputs.short-commit }} bundle_id: ${{ inputs.bundle_id }} bundle_id_suffix: ${{ inputs.bundle_id_suffix }} secrets: inherit tests-build: if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_BUILD == '1' }} - needs: serialize + needs: shared uses: ./.github/workflows/sidestore-tests-build.yml with: release_tag: ${{ inputs.release_tag }} - short_commit: ${{ needs.serialize.outputs.short-commit }} + short_commit: ${{ needs.shared.outputs.short-commit }} secrets: inherit tests-run: if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }} - needs: [serialize, tests-build] + needs: [shared, tests-build] uses: ./.github/workflows/sidestore-tests-run.yml with: release_tag: ${{ inputs.release_tag }} - short_commit: ${{ needs.serialize.outputs.short-commit }} + short_commit: ${{ needs.shared.outputs.short-commit }} secrets: inherit deploy: - needs: [serialize, build, tests-build, tests-run] # Keep tests-run in needs + needs: [shared, build, tests-build, tests-run] # Keep tests-run in needs if: ${{ always() && (needs.tests-run.result == 'skipped' || needs.tests-run.result == 'success') }} uses: ./.github/workflows/sidestore-deploy.yml with: @@ -91,7 +97,7 @@ jobs: upstream_tag: ${{ inputs.upstream_tag }} upstream_name: ${{ inputs.upstream_name }} version: ${{ needs.build.outputs.version }} - short_commit: ${{ needs.serialize.outputs.short-commit }} + short_commit: ${{ needs.shared.outputs.short-commit }} release_channel: ${{ needs.build.outputs.release-channel }} marketing_version: ${{ needs.build.outputs.marketing-version }} bundle_id: ${{ inputs.bundle_id }} diff --git a/.github/workflows/sidestore-serialize.yml b/.github/workflows/sidestore-shared.yml similarity index 51% rename from .github/workflows/sidestore-serialize.yml rename to .github/workflows/sidestore-shared.yml index b5df50a7..1f9cc79e 100644 --- a/.github/workflows/sidestore-serialize.yml +++ b/.github/workflows/sidestore-shared.yml @@ -1,23 +1,18 @@ -name: SideStore Serialize +name: SideStore Shared on: workflow_call: outputs: short-commit: - value: ${{ jobs.serialize.outputs.short-commit }} + value: ${{ jobs.shared.outputs.short-commit }} jobs: - serialize: - name: Wait for other jobs - # since build cache, test-build cache, test-run cache are involved, out of order exec if serialization is on individual jobs will wreak all sorts of havoc - # so we serialize on the entire workflow - concurrency: - group: serialize-workflow + shared: + name: Shared Steps strategy: fail-fast: false runs-on: 'macos-15' steps: - - run: echo "No other contending jobs are running now..." - name: Set short commit hash id: commit-id run: |