README updates, esp for example #717
Workflow file for this run
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: [ main ] | |
pull_request: | |
branches: [ '*' ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: short | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
rust: ${{ steps.filter.outputs.rust }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
rust: | |
- '**/Cargo.*' | |
- '**/src/**' | |
- '**/tests/**' | |
- '**/config/**' | |
- '**/build.rs' | |
- '**/migrations/**' | |
- '**/fixtures/**' | |
coverage: | |
needs: changes | |
if: ${{ needs.changes.outputs.rust == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup IPFS | |
uses: ibnesayeed/setup-ipfs@master | |
with: | |
run_daemon: false | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Cache Project | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
save-if: ${{ github.event_name == 'push' }} | |
- name: Sccache | |
uses: mozilla-actions/sccache-action@v0.0.3 | |
- name: Use mold-linker | |
uses: rui314/setup-mold@v1 | |
- name: Install Rust Toolchain | |
id: toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Override rust-toolchain.toml | |
run: rustup override set ${{steps.toolchain.outputs.name}} | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate Code Coverage | |
run: cargo llvm-cov --all-features --workspace --doctests --lcov --output-path lcov.info | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
files: lcov.info |