Skip to content

Commit

Permalink
Fix disk usage of the coverage workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli authored Feb 29, 2024
1 parent abd7afc commit f1d3ac1
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ env:
RUST_BACKTRACE: 1
PRUSTI_ASSERT_TIMEOUT: 60000
# Disable incremental builds to reduce disk usage
CARGO_INCREMENTAL: 1
CARGO_INCREMENTAL: 0
# The /mnt disk has 66 GB of free space; more than the working directory
COVERAGE_PATH: /mnt/prusti-coverage

jobs:
test:
Expand All @@ -27,19 +29,11 @@ jobs:
- name: Set up the environment
run: python x.py setup

- name: Report disk usage
run: df -h

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "shared"

- name: Enable collection of source-based coverage
run: |
# The following are necessary for profiling (see https://github.com/mozilla/grcov)
echo "RUSTFLAGS=-Cinstrument-coverage" >> $GITHUB_ENV
echo "LLVM_PROFILE_FILE=${GITHUB_WORKSPACE}/target/coverage/gcov-%p-%m.profraw" >> $GITHUB_ENV
echo "LLVM_PROFILE_FILE=${COVERAGE_PATH}/gcov-%p-%m.profraw" >> $GITHUB_ENV
- name: Report disk usage
run: df -h
Expand All @@ -50,9 +44,6 @@ jobs:
- name: Report disk usage
run: df -h

- name: Clear coverage generated by prusti-contracts-build
run: rm -rf target/coverage

- name: Report disk usage
run: df -h

Expand Down Expand Up @@ -89,7 +80,7 @@ jobs:
- name: Collect coverage
run: |
curl -sL https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
./grcov . --llvm --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
./grcov "$COVERAGE_PATH" --llvm --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down

0 comments on commit f1d3ac1

Please sign in to comment.