Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Coverage

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Show Rust versions
run: |
rustc --version
cargo --version

- name: Install required components
run: |
rustup component add rustfmt
rustup component add clippy
rustup component add llvm-tools-preview

- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-coverage-cargo-registry-${{ hashFiles('cli/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-coverage-cargo-index-${{ hashFiles('cli/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v4
with:
path: cli/target
key: ${{ runner.os }}-coverage-cargo-build-${{ hashFiles('cli/Cargo.lock') }}

- name: Run coverage script (full clean)
run: ./coverage.sh --full-clean

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: cli/target/llvm-cov/html

- name: Upload LCOV file
uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: cli/target/coverage/lcov.info
3 changes: 3 additions & 0 deletions cli/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
# Run coverage with HTML output (requires cargo-llvm-cov installed)
coverage = "llvm-cov --workspace --all-features --html"
Loading
Loading