Skip to content

Commit 94c764e

Browse files
committed
Merge #95: Add coverage CI workflow
b4092b6 fix: [#90] add SKIP_AI_ENFORCEMENT to coverage steps (copilot-swe-agent[bot]) 7653193 fix: [#90] add explicit permissions to coverage workflow (copilot-swe-agent[bot]) 5afe9f8 feat: [#90] add coverage CI workflow (copilot-swe-agent[bot]) 213b269 Initial plan (copilot-swe-agent[bot]) Pull request description: - [x] Add `SKIP_AI_ENFORCEMENT: 1` environment variable to coverage steps - [x] Applied to both `coverage-text` and `coverage-html` steps - [x] Matches pattern from `testing.yml` workflow - [x] Skips AI enforcement tests that require third-party tools (cargo machete, Ansible, OpenTofu) - [x] YAML linting passes <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Create coverage CI workflow</issue_title> > <issue_description>**Parent Epic**: #85 > > ## Overview > > Create a GitHub Actions workflow to generate code coverage reports on every push and pull request. The workflow generates coverage in two formats: a text summary for immediate viewing in the workflow output, and an HTML report uploaded as an artifact for detailed inspection. > > **Note**: This issue does NOT include Codecov or other external coverage service integration. > > ## Goals > > - [ ] Generate coverage reports automatically in CI/CD for all branches > - [ ] Display coverage summary in workflow output (text format) > - [ ] Make detailed HTML coverage reports available as artifacts > - [ ] Add `.coverage/` directory to `.gitignore` > > ## Specifications > > ### Workflow Structure > > **Trigger Events**: Push and pull_request (following `testing.yml` pattern) > > **Job**: Single `coverage` job with these steps: > > 1. Checkout code - `actions/checkout@v4` > 2. Setup Rust toolchain - `dtolnay/rust-toolchain@stable` > 3. Enable caching - `Swatinem/rust-cache@v2` > 4. Install cargo-llvm-cov - `taiki-e/install-action@v2` > 5. Generate text coverage - `cargo cov` > 6. Generate HTML report - `cargo cov-html` > 7. Upload HTML artifact - `actions/upload-artifact@v4` > > ### Example Workflow > > ```yaml > name: Coverage > > on: > push: > pull_request: > > env: > CARGO_TERM_COLOR: always > > jobs: > coverage: > name: Coverage Report > runs-on: ubuntu-latest > > steps: > - id: checkout > name: Checkout Repository > uses: actions/checkout@v4 > > - id: setup > name: Setup Toolchain > uses: dtolnay/rust-toolchain@stable > > - id: cache > name: Enable Workflow Cache > uses: Swatinem/rust-cache@v2 > > - id: install-llvm-cov > name: Install cargo-llvm-cov > uses: taiki-e/install-action@v2 > with: > tool: cargo-llvm-cov > > - id: coverage-text > name: Generate Text Coverage Summary > run: cargo cov > > - id: coverage-html > name: Generate HTML Coverage Report > run: cargo cov-html > > - id: upload-coverage > name: Upload HTML Coverage Report > uses: actions/upload-artifact@v4 > with: > name: coverage-html-report > path: target/llvm-cov/html/ > retention-days: 30 > ``` > > ## Implementation Plan > > ### Phase 1: Update .gitignore (5 minutes) > > - [ ] Add `.coverage/` directory to `.gitignore` with comment > > ### Phase 2: Create Workflow (15 minutes) > > - [ ] Create `.github/workflows/coverage.yml` > - [ ] Add trigger events and environment variables > - [ ] Set up job structure > > ### Phase 3: Configure Toolchain (10 minutes) > > - [ ] Add Rust toolchain setup, caching, and cargo-llvm-cov installation > > ### Phase 4: Generate Reports (15 minutes) > > - [ ] Add text and HTML coverage generation steps > > ### Phase 5: Upload Artifact (10 minutes) > > - [ ] Add artifact upload step with 30-day retention > > ### Phase 6: Testing (15 minutes) > > - [ ] Test workflow on a feature branch > - [ ] Verify text output and HTML artifact availability > > ## Acceptance Criteria > > - [ ] `.coverage/` directory added to `.gitignore` > - [ ] Workflow file exists at `.github/workflows/coverage.yml` > - [ ] Workflow triggers on push and pull_request > - [ ] Text coverage summary visible in workflow output > - [ ] HTML coverage artifact uploaded with 30-day retention > - [ ] Workflow does NOT block CI/CD on coverage failures > > ## Notes > > - Uses `cov` and `cov-html` aliases from `.cargo/config.toml` > - Follows patterns from existing `testing.yml` workflow > - Non-blocking by design - coverage is informational only > - Future enhancement: External coverage service integration can be added later</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes #87 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). ACKs for top commit: josecelano: ACK b4092b6 Tree-SHA512: f5ee09387a3b4de3183ec90dcccebe771b8925722be123dd1715bfdb6fa3058fa5958548a2893ead822256cd33879e69438e59165866a50736a18123569c44d4
2 parents e813fe2 + b4092b6 commit 94c764e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
coverage:
15+
name: Coverage Report
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- id: checkout
20+
name: Checkout Repository
21+
uses: actions/checkout@v4
22+
23+
- id: setup
24+
name: Setup Toolchain
25+
uses: dtolnay/rust-toolchain@stable
26+
27+
- id: cache
28+
name: Enable Workflow Cache
29+
uses: Swatinem/rust-cache@v2
30+
31+
- id: install-llvm-cov
32+
name: Install cargo-llvm-cov
33+
uses: taiki-e/install-action@v2
34+
with:
35+
tool: cargo-llvm-cov
36+
37+
- id: coverage-text
38+
name: Generate Text Coverage Summary
39+
env:
40+
SKIP_AI_ENFORCEMENT: 1
41+
run: cargo cov
42+
43+
- id: coverage-html
44+
name: Generate HTML Coverage Report
45+
env:
46+
SKIP_AI_ENFORCEMENT: 1
47+
run: cargo cov-html
48+
49+
- id: upload-coverage
50+
name: Upload HTML Coverage Report
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: coverage-html-report
54+
path: target/llvm-cov/html/
55+
retention-days: 30

0 commit comments

Comments
 (0)