-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Added code coverage CI (#1236)
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 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,55 @@ | ||
name: Coverage | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
env: | ||
RUSTFLAGS: "-D warnings" | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ${{ matrix.platform }} | ||
name: "${{ matrix.example }} - ${{ matrix.platform }}" | ||
strategy: | ||
matrix: | ||
platform: [macos-latest] | ||
toolchain: [stable] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Homebrew | ||
run: | | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
- name: Install LLVM | ||
run: brew install llvm | ||
- name: Add LLVM to PATH | ||
run: echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH | ||
- name: Install cargo-llvm-cov | ||
run: brew install cargo-llvm-cov | ||
- name: Llvm version | ||
run: llvm-config --version | ||
- name: Clang version | ||
run: clang --version | ||
- name: "${{ matrix.toolchain }} with rustfmt, and wasm32" | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.toolchain }} | ||
target: wasm32-unknown-unknown | ||
- name: Set Default Toolchain | ||
run: rustup override set ${{ matrix.toolchain }} | ||
- name: Rust version | ||
run: rustc --version --verbose | ||
- name: Add rust-src component | ||
run: rustup component add rust-src --toolchain ${{ matrix.toolchain }} | ||
- name: Verify Rust Toolchain | ||
run: rustup show | ||
- name: Generate code coverage | ||
run: cargo +${{ matrix.toolchain }} llvm-cov --lcov --output-path llvm-cov-output.lcov | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./llvm-cov-output.lcov | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |