diff --git a/.github/workflows/codecov-coverage.yml b/.github/workflows/codecov-coverage.yml new file mode 100644 index 0000000000..267d8acbc1 --- /dev/null +++ b/.github/workflows/codecov-coverage.yml @@ -0,0 +1,40 @@ +name: codecov-coverage +# This CI is run manually on-demand and performs a simple calculation of +# unit tests coverage and reports it to CodeCov +permissions: + contents: read +on: + workflow_dispatch: + +jobs: + coverage: + runs-on: ubuntu-latest + name: ubuntu / stable / coverage + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + + - name: cargo llvm-cov + run: cargo llvm-cov --locked --lcov --output-path lcov.info + + - name: Record Rust version + run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV" + + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + env_vars: OS,RUST