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

Split swift-toolchain.yml triggers into seperate workflows #159

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

kendalharland
Copy link
Contributor

@kendalharland kendalharland commented Jun 14, 2024

This PR refactors swift-toolchain.yml so that it has no automated triggers. Instead it is only run via one of:

  • workflow_call
  • workflow_dispatch.

This PR also adds three new workflows that each include a vars.USE_CIRUN kill switch:

  • pull-request-swift-toolchain-github.yml
    • runs swift-toolchain.yml with GitHub images on pull_request
    • does not create releases
  • pull-request-swift-toolchain-cirun.yml
    • runs swift-toolchain.yml with Cirun images on pull_request
    • does not create releases
  • schedule-swift-toolchain.yml
    • runs swift-toolchain.yml every 6 hours with Azure images on schedule
    • creates releases

Separate workflows must be used for the pull-request* workflows instead of one parent workflow that uses GitHub and Cirun images via a matrix. This is because the child workflows called from the parent would upload artifacts with identical names, and race. The first uploader wins while the second fails. It is easier to handle this using separate workflow files than it is to - for example - namespace the uploads using a string prefix, inside swift-toolchain.yml

swft-toolchain.yml is also updated with these inputs:

  • default_runner
    • The runner to use for nearly all steps. "default_runner" is used instead of "windows_runner" to make this behavior more obvious.
  • compiler_runner
    • The runner to use for compiler steps
  • publish_artifacts
    • controls whether artifacts are uploaded.

@kendalharland kendalharland force-pushed the kendal/azure-gh-pr-matrix branch 9 times, most recently from 5bdc34b to ea5a94a Compare June 14, 2024 23:40
@kendalharland kendalharland requested review from compnerd, tristanlabelle and hyp and removed request for compnerd June 14, 2024 23:46
@kendalharland
Copy link
Contributor Author

kendalharland commented Jun 14, 2024

Happy to upstream the changes to the workflow inputs to compnerd/swift-build. Still sending this for review in the meantime so I can get feedback while the tests run.

@kendalharland kendalharland changed the title Trigger separate jobs for Azure & GH images on pull_request Split swift-toolchain.yml triggers into seperate workflows Jun 14, 2024
Copy link
Contributor

@tristanlabelle tristanlabelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

.github/workflows/swift-toolchain.yml Outdated Show resolved Hide resolved
.github/workflows/swift-toolchain.yml Show resolved Hide resolved
@kendalharland
Copy link
Contributor Author

Upstreamed most of the changes to swift-toolchain.yml and will rebase once compnerd/swift-build#747 is merged.

@kendalharland kendalharland force-pushed the kendal/azure-gh-pr-matrix branch 6 times, most recently from f5d3554 to b1abe21 Compare June 18, 2024 16:22
@kendalharland
Copy link
Contributor Author

This PR is failing to package swift-inspect on cirun because of an if-statement. This will be fixed by compnerd/swift-build#749

@kendalharland
Copy link
Contributor Author

Update, this change is g2g, just waiting on the base swift-toolchain.yml build to turn green. @z2oh is currently working to resolve.

@kendalharland kendalharland merged commit 22a05f1 into main Jun 26, 2024
79 checks passed
@kendalharland kendalharland deleted the kendal/azure-gh-pr-matrix branch June 26, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants