diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..2c9b510 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,49 @@ +name: Coverage + +on: + pull_request: + branches: [ "*" ] + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + coverage: + name: LLVM coverage report + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-llvm-cov-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-llvm-cov- + ${{ runner.os }}-cargo- + + - name: Install cargo-llvm-cov + run: cargo install --locked cargo-llvm-cov || true + + - name: Generate LCOV report + run: cargo llvm-cov --locked --lcov --output-path lcov.info + + - name: Upload LCOV report + uses: actions/upload-artifact@v4 + with: + name: telemt-lcov + path: lcov.info