-
-
Notifications
You must be signed in to change notification settings - Fork 0
175 #179
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
175 #179
Conversation
…se 1) Implemented Phase 1 improvements for enterprise-grade CI/CD: #176 Concurrency Control: - Added concurrency groups to ci.yml and release.yml - Prevents redundant CI runs on PR updates - Saves CI minutes and provides faster feedback #177 Code Coverage Reporting: - Integrated cargo-llvm-cov for accurate coverage tracking - Added dedicated coverage job with Codecov upload - Enables coverage visibility in PRs and trend tracking #178 Matrix Strategy: - Introduced matrix testing for MSRV and stable Rust versions - Separated MSRV detection into dedicated job for reusability - README and package operations run only on MSRV to avoid duplication - fmt, deny, and audit run once per workflow to optimize CI time Benefits: - Faster CI feedback through parallel execution - Better test coverage across Rust versions - Resource-efficient workflow execution - Foundation for future multi-platform testing
.github/workflows/reusable-ci.yml
Outdated
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
- General fix: Explicitly set a
permissions:block so that the workflow (or individual jobs) only receive the minimal required set of permissions for their steps to work. - Best single fix for this snippet:
Add a top-levelpermissions:block (applies to all jobs) with the most restrictive feasible permissions, e.g.permissions: { contents: read }, and extend specific jobs that need more (here likely thecijob, specifically where it commits, pushes, or makes a pull request) with apermissions:block givingcontents: writeandpull-requests: write. - Specific changes:
- Add at the top level of the workflow (
permissions:aftername:and beforeon:) withcontents: read. - In the
cijob, add apermissions:block setting:beforepermissions: contents: write pull-requests: write
runs-on: ubuntu-latest.
- Add at the top level of the workflow (
- What is needed:
- Insert top-level
permissions: contents: read - Add job-level explicit permissions for
cijob as above.
- Insert top-level
-
Copy modified lines R6-R7 -
Copy modified lines R42-R44
| @@ -3,6 +3,8 @@ | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: Reusable CI | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_call: | ||
| @@ -37,6 +39,9 @@ | ||
| echo "Using MSRV: $RV" | ||
|
|
||
| ci: | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| runs-on: ubuntu-latest | ||
| needs: msrv | ||
| strategy: |
.github/workflows/reusable-ci.yml
Outdated
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To resolve this issue, add a permissions: block specifying the minimum required permissions, thereby adhering to the principle of least privilege. The best practice is to place this block at the top level of the workflow YAML file, so that all jobs inherit least-privilege permissions unless overridden at the job level.
- Add a top-level
permissions:block after thename:declaration, beforeon:. - For most CI/CD workflows that do not require write access to repository contents, the recommended setting is
contents: read. - If jobs require other permissions (e.g.,
pull-requests: writeorcontents: writefor auto-committing changes), consider setting those at the individual job level. However, as a minimal fix and starting point, setcontents: readat the top level.
What to change:
- Add after line
5: name: Reusable CIa block:permissions: contents: read - If later, any job (e.g., the "auto-commit README changes" step) is shown to need
contents: write, you may override the permissions for that specific job. For now, the minimal recommended fix is to set the top-level block to restrict all jobs to read-only.
-
Copy modified lines R6-R7
| @@ -3,6 +3,8 @@ | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: Reusable CI | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_call: |
Summary
Implemented Phase 1 enterprise-grade CI/CD improvements with concurrency control, code coverage reporting, and matrix strategy for multi-version testing.
Changes
#176 Concurrency Control
ci.ymlandrelease.yml#177 Code Coverage Reporting
cargo-llvm-covfor accurate coverage trackingcoveragejob with Codecov integration#178 Matrix Strategy
Benefits
Test Plan
cargo test --all-features)Next Steps (Phase 2 & 3)
Closes #176
Closes #177
Closes #178