-
Notifications
You must be signed in to change notification settings - Fork 48
ci: consolidate workflows into single ci.yml #74
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
Conversation
Merge `code-quality.yml`, `ios-build-test.yml`, and `pr-validation.yml` into a unified `ci.yml` workflow. All 6 jobs run in parallel with unified trigger conditions and concurrency control. Jobs: - lint: SwiftLint checks - swiftformat: SwiftFormat code style checks - pr-size: PR size labeling - check-commits: Conventional commit validation - build-and-test: Build and run tests - code-coverage: Test coverage reporting This reduces workflow file count from 3 to 1 for easier maintenance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR consolidates three separate GitHub Actions workflow files (code-quality.yml, ios-build-test.yml, and pr-validation.yml) into a single unified ci.yml workflow for improved maintainability. The consolidation preserves all 6 original jobs (lint, swiftformat, pr-size, check-commits, build-and-test, code-coverage) while unifying trigger conditions and adding concurrency control.
- Merges 3 workflow files into 1 unified CI workflow
- Enables all jobs to run in parallel with appropriate conditions
- Adds concurrency control to cancel outdated workflow runs
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
New consolidated workflow combining all CI jobs with unified triggers and concurrency control |
.github/workflows/pr-validation.yml |
Removed - functionality moved to ci.yml (lint, pr-size, check-commits jobs) |
.github/workflows/ios-build-test.yml |
Removed - functionality moved to ci.yml (build-and-test job) |
.github/workflows/code-quality.yml |
Removed - functionality moved to ci.yml (swiftformat, code-coverage jobs) |
| for (const label of labels.data) { | ||
| if (label.name.startsWith('size/')) { | ||
| await github.rest.issues.removeLabel({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: pr.number, | ||
| name: label.name |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable name collision: the loop variable label on line 125 shadows the label variable defined on line 110. This will cause the size label calculation to be overwritten during the loop. Consider renaming the loop variable to something like existingLabel to avoid this conflict.
for (const existingLabel of labels.data) {
if (existingLabel.name.startsWith('size/')) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: existingLabel.name
});
}
}| for (const label of labels.data) { | |
| if (label.name.startsWith('size/')) { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| name: label.name | |
| for (const existingLabel of labels.data) { | |
| if (existingLabel.name.startsWith('size/')) { | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| name: existingLabel.name |
| xcrun xccov view --report --json "$RESULT_BUNDLE" > coverage.json || echo '{}' > coverage.json | ||
|
|
||
| # Extract coverage percentage with fallback | ||
| COVERAGE=$(cat coverage.json | jq -r '.lineCoverage // 0' | awk '{printf "%.2f", $1 * 100}') |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless use of cat: The command cat coverage.json | jq can be simplified to jq '...' coverage.json which is more efficient and follows best practices by avoiding an unnecessary pipe.
COVERAGE=$(jq -r '.lineCoverage // 0' coverage.json | awk '{printf "%.2f", $1 * 100}')| COVERAGE=$(cat coverage.json | jq -r '.lineCoverage // 0' | awk '{printf "%.2f", $1 * 100}') | |
| COVERAGE=$(jq -r '.lineCoverage // 0' coverage.json | awk '{printf "%.2f", $1 * 100}') |
Summary
code-quality.yml,ios-build-test.yml, andpr-validation.ymlinto a unifiedci.ymlJobs
lintswiftformatpr-sizecheck-commitsbuild-and-testcode-coverageChanges
.github/workflows/ci.yml- Consolidated workflow.github/workflows/code-quality.yml.github/workflows/ios-build-test.yml.github/workflows/pr-validation.yml.github/workflows/release.yml(different trigger: version changes).github/workflows/dependency-update.yml(scheduled workflow)Reference
Based on grayverse/ULPB-iOS#106
Test plan
🤖 Generated with Claude Code