test: fix coverage ci (#316) #166
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
name: Code Coverage | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
- '**.png' | |
env: | |
RUST_TOOLCHAIN: nightly | |
TOOLCHAIN_PROFILE: minimal | |
jobs: | |
coverage: | |
name: Run cargo coverage | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: ${{ env.TOOLCHAIN_PROFILE }} | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
override: true | |
components: llvm-tools-preview | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /home/runner/.cargo/bin/cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info" | |
- name: Upload coverage to Codecov | |
run: bash <(curl -s https://codecov.io/bash) -f lcov.info -t ${{ secrets.CODECOV_TOKEN }} |