Skip to content

Commit

Permalink
get coverage from running pkgx (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 14, 2025
1 parent 3738ceb commit 62b772a
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,64 @@ jobs:
env:
RUSTFLAGS: "-D warnings"

smoke:
coverage-unit:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
needs: [check]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --all-features -- git --version
- run: cargo install cargo-tarpaulin
- run: cargo tarpaulin -o lcov --output-dir coverage
- uses: coverallsapp/github-action@v2
with:
path-to-lcov: coverage/lcov.info
parallel: true
flag-name: ${{ matrix.os }}

coverage:
coverage-integration:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cargo-tarpaulin
- run: cargo tarpaulin -o lcov --output-dir coverage

- name: build
run: |
RUSTFLAGS="-C instrument-coverage" cargo build
echo "$PWD/target/debug" >> $GITHUB_PATH
- name: run integrations
run: |
pkgx --help
pkgx --version
pkgx +git
pkgx +git --json
pkgx git --version
- name: generate coverage
run: |
cargo install rustfilt
pkgx +llvm.org -- llvm-profdata merge -sparse default_*.profraw -o default.profdata
pkgx +llvm.org -- llvm-cov export \
./target/debug/pkgx \
--format=lcov \
--ignore-filename-regex="$HOME/.cargo" \
--instr-profile=default.profdata \
-Xdemangler=rustfilt \
> lcov.info
- uses: coverallsapp/github-action@v2
with:
path-to-lcov: coverage/lcov.info
path-to-lcov: lcov.info
parallel: true
flag-name: ${{ matrix.os }}

upload-coverage:
needs: coverage
needs: [coverage-unit, coverage-integration]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 62b772a

Please sign in to comment.