-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add codecov coverage report (#115)
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
- main | ||
merge_group: | ||
types: [checks_requested] | ||
workflow_dispatch: {} | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -103,4 +104,29 @@ jobs: | |
- name: Build with all features | ||
run: cargo test --verbose --all-features --no-run | ||
- name: Tests with all features | ||
run: cargo test --verbose --all-features | ||
run: cargo test --verbose --all-features | ||
|
||
coverage: | ||
if: github.event_name != 'merge_group' | ||
needs: [tests, check] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mozilla-actions/[email protected] | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: llvm-tools-preview | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Run tests with coverage instrumentation | ||
run: | | ||
cargo llvm-cov clean --workspace | ||
cargo llvm-cov --doctests | ||
- name: Generate coverage report | ||
run: cargo llvm-cov report --codecov --output-path coverage.json | ||
- name: Upload coverage to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: coverage.json | ||
name: ubuntu | ||
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