name: Code coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions: {}
env:
CARGO_TERM_COLOR: always
jobs:
code_coverage:
name: Code Coverage
runs-on: "ubuntu-latest"
if: github.event_name == 'push' || !github.event.pull_request.draft
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
- name: Load cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@a37010ded18ff788be4440302bd6830b1ae50d8b
with:
tool: cargo-llvm-cov
- name: Install nextest
uses: taiki-e/install-action@a37010ded18ff788be4440302bd6830b1ae50d8b
with:
tool: nextest
- name: Install just
uses: taiki-e/install-action@a37010ded18ff788be4440302bd6830b1ae50d8b
with:
tool: just
- name: Create the coverage report
run: just coverage-codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3
with:
files: ./target/nextest/ci/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}