name: Code Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Generate code coverage
run: |
echo "Current directory: $(pwd)"
echo "Contents of current directory:"
ls -la
echo "Checking if config exists:"
ls -la config/ || echo "No config directory"
echo "Environment variables:"
env | grep -E "(SDTN|DTN)" || echo "No SDTN/DTN env vars"
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}