chore: Improve coverage workflow (#738)

* fix: reduce space requirements
- run tests to get coverage

* fix: schedule on 3am UTC
- use binstall for grcov
This commit is contained in:
Roman Zajic 2024-09-18 08:43:35 +08:00 committed by GitHub
parent 8a1e705792
commit fadf6d010b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 16 deletions

View File

@ -1,16 +1,16 @@
on: on:
pull_request: schedule:
push: - cron: '0 3 * * *'
branches: workflow_dispatch:
- master
name: Codecov name: Codecov
jobs: jobs:
test: test:
name: Test
env: env:
RUSTFLAGS: -C instrument-coverage CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "nomos-node-%p-%m.profraw"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -34,17 +34,24 @@ jobs:
run: cargo binstall -y cargo-risczero && cargo risczero install run: cargo binstall -y cargo-risczero && cargo risczero install
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: | - name: Cargo build
cargo binstall -y grcov; uses: actions-rs/cargo@v1
cargo build --no-default-features --features libp2p with:
rm -rf target/debug/{build,incremental,deps} command: build
cargo test --no-default-features --features libp2p --no-run args: --all --no-default-features --features libp2p
rm -rf target/debug/{build,incremental,deps} - name: Run tests
mkdir /tmp/cov; uses: actions-rs/cargo@v1
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov;
env: env:
SLOW_TEST_ENV: true
RISC0_DEV_MODE: true RISC0_DEV_MODE: true
CONSENSUS_SLOT_TIME: 5
with:
command: test
args: --all --no-default-features --features libp2p
- name: Run Grcov
run: |
cargo binstall -y grcov;
mkdir /tmp/cov;
grcov . --binary-path ./target/debug -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov;
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: failure() if: failure()
with: with: