-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage workflow to measure code quality (#11)
* Add coverage workflow to measure code quality * Add GRCov configuration and upload coverage reports to Codecov * add caching to codecov workflow * check for coverage files * modified grcov settings * modified grcov settings * Update output-path in grcov.yml and codecov.yml for coverage files * Commit changes to Codecov workflow to use grcov output * modified grcov settings * modified grcov settings * modified grcov settings * modified grcov settings * modified grcov settings * modified grcov settings * modified grcov settings * modified grcov settings * Update codecov.yml to specify async-event-emitter test package and args * Update grcov and codecov configuration and test dependencies in lib.rs * Update output-type and remove llvm flag * Remove unused `Context` import and serialize value directly in emit function --------- Co-authored-by: Spencerjibz <[email protected]>
- Loading branch information
1 parent
ca9cbc6
commit c359518
Showing
4 changed files
with
282 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
branch: true | ||
ignore-not-existing: true | ||
|
||
output-type: lcov | ||
output-path: coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Code Coverage | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: llvm-tools-preview | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-coverage | ||
|
||
- uses: actions-rs/cargo@v1 | ||
|
||
with: | ||
command: test | ||
args: --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
- name: Download grcov | ||
run: | | ||
mkdir -p "${HOME}/.local/bin" | ||
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.10/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] | ||
id: coverage | ||
with: | ||
config: .github/grcov.yml | ||
|
||
- name: List coverage files | ||
run: cat ${{steps.coverage.outputs.report}} >> coverage.Icov | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.