-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use llvm-cov for coverage (#478)
* feat: use llvm-cov for coverage * fix: ci * bump: rust cache action * fix: use nextest * misc: seperate doctest * fix: ci * fix: rustfmt * fix: windows incremental build * fix: disable debug info to save disk space * Update ci.yml * misc: use C drive for target dir * misc: updated CHANGELOG * fix: test
- Loading branch information
1 parent
b475164
commit e14879c
Showing
4 changed files
with
141 additions
and
78 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
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 |
---|---|---|
|
@@ -57,9 +57,17 @@ jobs: | |
include: | ||
- RUSTFLAGS: "-Dwarnings" | ||
CARGO_INCREMENTAL: 1 | ||
CARGO_TARGET_DIR: "target" | ||
- os: "windows-latest" | ||
RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static" | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_TARGET_DIR: "C:\\cargo-target-dir" | ||
env: | ||
RUSTFLAGS: ${{ matrix.RUSTFLAGS }} | ||
CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }} | ||
# Disable generating debug info, we don't need it here anyway and its only using disk space | ||
CARGO_PROFILE_DEV_DEBUG: 0 | ||
CARGO_TARGET_DIR: ${{ matrix.CARGO_TARGET_DIR }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -79,34 +87,75 @@ jobs: | |
with: | ||
profile: minimal | ||
override: true | ||
components: rustfmt | ||
components: rustfmt, llvm-tools-preview | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
if: matrix.os != 'windows-latest' | ||
|
||
- name: Doctests | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTFLAGS: ${{ matrix.RUSTFLAGS }} | ||
CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }} | ||
with: | ||
command: test | ||
args: --doc --all-features --profile min-artifact-size-debug | ||
- name: Install latest llvm-cov release | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- name: Install latest nextest release | ||
uses: taiki-e/install-action@nextest | ||
|
||
- run: Get-PSDrive | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Test with latest nextest release | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTFLAGS: ${{ matrix.RUSTFLAGS }} | ||
CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }} | ||
with: | ||
command: nextest | ||
args: run --all-features --profile ci --cargo-profile min-artifact-size-debug | ||
command: llvm-cov | ||
args: nextest --all-features --workspace --lcov --output-path lcov.info --profile ci | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: lcov.info | ||
name: ${{ matrix.os }} | ||
fail_ci_if_error: true | ||
|
||
doctest: | ||
name: Doctest Rust | ||
needs: check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "windows-latest", "macOS-latest" ] | ||
include: | ||
- RUSTFLAGS: "-Dwarnings" | ||
CARGO_INCREMENTAL: 1 | ||
- os: "windows-latest" | ||
RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static" | ||
CARGO_INCREMENTAL: 0 | ||
env: | ||
RUSTFLAGS: ${{ matrix.RUSTFLAGS }} | ||
CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }} | ||
# Disable generating debug info, we don't need it here anyway and its only using disk space | ||
CARGO_PROFILE_DEV_DEBUG: 0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install LLVM | ||
uses: ./.github/actions/install-llvm | ||
|
||
- name: Install packages | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libasound2-dev libudev-dev | ||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Doctests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc --all-features | ||
|
||
test-mdbook: | ||
name: Test mdbook | ||
|
@@ -248,37 +297,4 @@ jobs: | |
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features | ||
|
||
tarpaulin: | ||
runs-on: ubuntu-latest | ||
needs: check | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libasound2-dev libudev-dev | ||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
components: rustfmt | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install LLVM | ||
uses: ./.github/actions/install-llvm | ||
|
||
- name: Run cargo-tarpaulin | ||
uses: actions-rs/[email protected] | ||
|
||
- uses: codecov/codecov-action@v3 | ||
with: | ||
file: ${{ steps.coverage.outputs.report }} | ||
name: ${{ matrix.os }} | ||
args: --all-features |
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.