-
Notifications
You must be signed in to change notification settings - Fork 41
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
Update github workflow to upload test coverage reports #759
Changes from 9 commits
4a438c2
423cc45
8195c5e
334b510
7bc87b6
a114cdf
2c6c66a
eb797dd
7a1df50
1d40e59
5b63c2c
90b452d
13269b5
f57c2e0
eb06f35
511a7e2
91526c9
c9bc160
7e6ac54
a918dfa
2db1628
c1d8c5b
ed22a33
8bd17aa
d039f16
db85aa9
f51da52
6d58521
b741e76
56ebfdb
684c124
0759863
c21e5a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,25 @@ jobs: | |
default: true | ||
override: true | ||
profile: minimal | ||
components: rustfmt, clippy | ||
components: rustfmt, clippy, llvm-tools-preview | ||
|
||
- name: Cache Dependencies | ||
uses: Swatinem/rust-cache@v1 | ||
|
||
|
||
- name: Download grcov | ||
run: | | ||
mkdir -p "${HOME}/.local/bin" | ||
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.11/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Tests | ||
run: ./scripts/tests/${{ matrix.scripts }}.sh | ||
|
||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: /misc/tests.lcov | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to use /tmp/tests.lcov instead to avoid potential permission issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed in eb06f35 |
||
|
||
fuzz: | ||
name: Fuzz | ||
runs-on: ubuntu-latest | ||
|
@@ -56,11 +67,25 @@ jobs: | |
default: true | ||
override: true | ||
profile: minimal | ||
components: rustfmt, clippy | ||
components: rustfmt, clippy, llvm-tools-preview | ||
|
||
- name: Cache Dependencies | ||
uses: Swatinem/rust-cache@v1 | ||
Chralt98 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Download grcov | ||
run: | | ||
mkdir -p "${HOME}/.local/bin" | ||
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.11/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- uses: actions-rs/[email protected] | ||
with: | ||
crate: cargo-fuzz | ||
use-tool-cache: true | ||
|
||
- run: ./scripts/tests/fuzz.sh | ||
|
||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: /misc/fuzz.lcov |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,5 @@ test_package_with_feature() { | |
local features=$2 | ||
|
||
/bin/echo -e "\e[0;33m***** Testing '$package' with features '$features' *****\e[0m\n" | ||
cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features --release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should avoid profile release for tests, so that https://doc.rust-lang.org/cargo/reference/profiles.html#release |
||
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features --release | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the grcov GH action instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it. When running the
grcov
github action it always returns the following error.Although I executed
cargo test
as step before thegrcov
github action. I don't really know how to solve this.In the example they use a github action for cargo test, but we use a script instead. But shouldn't be the result the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find an example for grcov GH action for source-based coverage.