Skip to content

ci: Add code coverage job with cargo-llvm-cov #317

@Coldaine

Description

@Coldaine

Source

PR #234 - can be closed after this issue exists.

What it does

Adds a CI job that generates code coverage using cargo-llvm-cov and uploads to Codecov.

Key code (CI workflow snippet)

code-coverage:
  name: Code Coverage
  runs-on: [self-hosted, Linux, X64, fedora, nobara]
  needs: [setup-whisper-dependencies]
  steps:
    - uses: actions/checkout@v5
    - name: Set up Rust toolchain
      uses: actions-rust-lang/setup-rust-toolchain@v1
      with:
        toolchain: stable
        components: llvm-tools-preview
    - name: Setup ColdVox
      uses: ./.github/actions/setup-coldvox
      with:
        skip-toolchain: "true"
    - name: Install cargo-llvm-cov
      uses: taiki-e/install-action@cargo-llvm-cov
    - name: Generate code coverage
      env:
        WHISPER_MODEL_PATH: ${{ needs.setup-whisper-dependencies.outputs.model_path }}
        WHISPER_MODEL_SIZE: ${{ needs.setup-whisper-dependencies.outputs.model_size }}
      run: |
        pip install faster-whisper
        export PYTHONPATH=$(python3 -c "import site; print(site.getsitepackages()[0])")
        cargo llvm-cov --workspace --lcov --output-path lcov.info
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v4
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        files: lcov.info
        fail_ci_if_error: true

Implementation notes

  • Requires CODECOV_TOKEN secret (or use tokenless upload for public repos)
  • Adds CI runtime overhead
  • Should be added after main test suite is stable

Status

Defer until CI stabilizes; snippet ready to paste into ci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions