Skip to content

Commit

Permalink
ci: coverage in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Aug 8, 2024
1 parent 0de67de commit 71f3ea8
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Task - Integration Tests
on:
workflow_dispatch:
workflow_call:
pull_request:
branches: [main]

jobs:
coverage:
Expand All @@ -21,10 +23,30 @@ jobs:
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Coverage
run: cargo llvm-cov --codecov --output-path codecov.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3

- name: Build binary
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo build --bin deoxys --profile dev
- name: Launch Anvil
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number $ANVIL_BLOCK_NUMBER &
env:
ANVIL_FORK_URL: "https://eth.merkle.io"
ANVIL_BLOCK_NUMBER: 20395662

- name: Build and run tests
run: |
source <(cargo llvm-cov show-env --export-prefix)
export COVERAGE_BIN=$(realpath target/debug/deoxys)
rm -f target/madara-* lcov.info
cargo test --profile dev
- name: Generate coverage info
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo llvm-cov report --cobertura --output-path coverage.cobertura.xml
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
files: codecov.json
fail_ci_if_error: false
filename: coverage.cobertura.xml

0 comments on commit 71f3ea8

Please sign in to comment.