refactor(ci): Separate Build/Test and Documentation Workflows #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a major refactoring of the CI/CD pipeline to improve efficiency, clarity, and robustness, inspired by best practices from mature open-source projects.
The key goals are to speed up CI runs, provide better integration validation, and make the overall workflow system more modular and maintainable.
Key Changes & Rationale
1. Workflow Separation
ci.yml: Now exclusively handles building the library, running tests, and building the example app. It runs on all pushes and pull requests.documentation.yml: A new workflow dedicated to generating and deploying DocC documentation. It now runs only on pushes tomain.2. Example App Integration Test
build-example-appjob has been added toswift-ci.yml.xcodebuild, acting as a vital integration test that verifies thatPactKitCorecan be successfully consumed by a client application.3. Caching Strategy for Performance
test-and-build-libraryjob: Caches the.builddirectory, which is the artifact folder for theswift testcommand.build-example-appjob: Caches the~/Library/Developer/Xcode/DerivedDatadirectory, which is the artifact folder forxcodebuild.4. Concurrency Control
concurrencyblock to automatically cancel in-progress runs when new commits are pushed to the same branch, saving time and resources.