Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to restore coverage in CI #1689

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- "**" # target all branches
pull_request:
branches:
- master

name: Code Coverage

env:
# We partition coverage tests into multiple parts to avoid filling diskspace in a single runner
PARTITIONS_COUNT: 8

jobs:
coverage:
runs-on: ubuntu-latest

strategy:
matrix:
# This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above)
partition: [0, 1, 2, 3, 4, 5, 6, 7]

steps:
- name: Install dependencies
run: sudo apt-get install -yqq build-essential python3 python3-toml
- uses: actions/checkout@v1
- name: Install rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2024-03-20
- name: Run cargo clean
run: cargo clean
- name: Install grcov from cargo
run: cargo install grcov

- name: Run coverage tests
run: python3 build-tools/workspace-partition.py ${{ env.PARTITIONS_COUNT }} ${{ matrix.partition }} | xargs -I {} sh -c 'CARGO_INCREMENTAL=0 RUST_BACKTRACE=full RUST_LOG=debug RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTDOCFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTUP_TOOLCHAIN=nightly-2024-03-20 cargo test'

- name: Collect coverage data with grcov
run: grcov . --source-dir . --output-type lcov --branch --ignore-not-existing --binary-path ./target/debug/ -o grcov-report-${{ matrix.partition }}

- uses: actions/upload-artifact@v2
with:
name: code-coverage-report-${{ matrix.partition }}
path: grcov-report-${{ matrix.partition }}
76 changes: 0 additions & 76 deletions .github/workflows/coverage.yml.disabled

This file was deleted.

12 changes: 7 additions & 5 deletions .github/workflows/loom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ jobs:
test_loom:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Update local dependency repositories
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential python3 python3-toml podman build-essential pkg-config libssl-dev
- name: Install rust deps
run: sudo apt-get install -yqq build-essential pkg-config libssl-dev
- uses: actions/checkout@v2

- name: Install rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(python3 ./build-tools/rust-version-extractor/rust-version-extractor.py)
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Run permutation tests
run: cargo test --tests --release -p storage -p chainstate-storage -p storage-lmdb -p storage-inmemory
Loading