Testing swift-format as part of Swift’s CI infrastructure

In the last couple of weeks, we have made changes to the Swift testing infrastructure that allow testing dependent projects of SwiftSyntax without needing to rebuild SwiftSyntax. As a result, it would now be possible to test swift-format as part of the Swift CI testing infrastructure.

Integrating swift-format with the Swift CI infrastructure would allow PR testing on the apple/swift-format repository. Additionally, swift-format would be tested as part of Swift’s continuous integration jobs, ensuring that no change to the master branch of SwiftSyntax or the Swift compiler will break the master branch of swift-format.

The integration comes with the expectation that developers of swift-format take active part in fixing CI issues in a timely manner. Because of this, we leave it up to you to decide when and if the CI integration should be pushed forward. I have composed a list of the items below that need to be done in order to get the CI integration working:

[1] We are only building SwiftSyntax once without testability enabled, because that’s the version we are installing in the toolchain. SwiftPM does not support building targets with different build configurations, so we cannot build swift-format with testability enabled.

CC @allevato

6 Likes

Thanks for the detailed steps, Alex! Having swift-format integrated into the rest of the CI pipeline and getting PR testing will be a great improvement to our workflows.

Since we'll need some time to migrate to the latest SwiftSyntax API changes that were recently pushed, I think we'll tentatively aim to work on this after Thanksgiving.

Sounds like a good plan to me. Please let me know if you run into any questions during the integrations and I should be able to help you out.

Terms of Service

Privacy Policy

Cookie Policy