Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Coverage

on:
push:
branches:
- develop

env:
CARGO_TERM_COLOR: always

jobs:
report:
name: Generate Coverage Report
environment: coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install LLVM tools
run: sudo apt-get update && sudo apt-get install -y llvm

- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: llvm-tools-preview

- id: cache
name: Enable Workflow Cache
uses: Swatinem/rust-cache@v2

- id: tools
name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: grcov,cargo-llvm-cov

- id: coverage
name: Generate Coverage Report
run: |
cargo clean
cargo llvm-cov --all-features --workspace --codecov --output-path ./codecov.json

- id: upload
name: Upload Coverage Report
uses: codecov/codecov-action@v5
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/codecov.json
fail_ci_if_error: true
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Generate Coverage Report
name: Generate Coverage Report (PR)

on:
push:
branches:
- develop
pull_request:
branches:
- develop
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Upload Coverage Report
name: Upload Coverage Report (PR)

on:
# This workflow is triggered after every successfull execution
# of `Generate Coverage Report` workflow.
workflow_run:
workflows: ["Generate Coverage Report"]
workflows: ["Generate Coverage Report (PR)"]
types:
- completed

Expand Down