Skip to content

Commit

Permalink
iox-#5 Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jun 22, 2022
1 parent a9ba2f7 commit dfb59be
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,61 @@ jobs:
run: |
sudo apt update
sudo apt install -y libacl1-dev libncurses5-dev
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --all --examples
- name: Run tests
run: cargo test -- --test-threads=1 # prevent running multiple RouDiEnvironments in parallel

coverage:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
componets: llvm-tools-preview
- uses: actions/checkout@v3
with:
submodules: recursive
name: Install dependencies
run: |
sudo apt update
sudo apt install -y libacl1-dev libncurses5-dev
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-coverage-llvm-tools-preview
- name: Build
env:
RUSTFLAGS: -Cinstrument-coverage
run: cargo build
- name: Run test
env:
LLVM_PROFILE_FILE: grcov-%p-%m.profraw
RUSTFLAGS: -Cinstrument-coverage
run: cargo test -- --test-threads=1 # prevent running multiple RouDiEnvironments in parallel
- name: Generate coverage
run: |
./target/debug/grcov $(find . -name "grcov-*.profraw" -print) \
--branch \
--ignore-not-existing \
--binary-path ./target/debug/ \
-s . \
-t lcov \
--ignore "/*" \
-o lcov.info

0 comments on commit dfb59be

Please sign in to comment.