diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 46b23df..a815ddc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,7 +7,7 @@ on: pull_request: branches: - main - + jobs: build: runs-on: ubuntu-latest @@ -48,5 +48,21 @@ jobs: - name: Run cargo clippy run: cargo clippy -- -D warnings - - name: Run cargo test - run: cargo test --verbose --no-fail-fast \ No newline at end of file + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin + + - name: Run cargo tarpaulin + run: cargo tarpaulin --rustflags="-C opt-level=0" --no-fail-fast --out xml + + - name: Generate Code Coverage Summary + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: cobertura.xml + badge: true + fail_below_min: true + thresholds: '50 85' + output: both + format: markdown + + - name: Export Job Summary + run: echo "$(> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/tarpaulin.toml b/tarpaulin.toml new file mode 100644 index 0000000..a3b33e8 --- /dev/null +++ b/tarpaulin.toml @@ -0,0 +1,5 @@ +# https://github.com/xd009642/tarpaulin/blob/develop/tarpaulin.toml +[test_config] + +# List of file paths to exclude from testing. +exclude-files = ["solochain/*", "pallets/drand/examples/solochain/*"] \ No newline at end of file