Ci/coverage badge (#191)

* ci: coverage badge
This commit is contained in:
z9rtm 2025-05-19 10:07:01 +09:00 • committed by GitHub
commit 4dc0cad499
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,8 +5,12 @@ on:
branches: [ main, release ]
tags:
- 'release-*'
paths-ignore:
- "**/coverage.svg"
pull_request:
branches: [ main, release ]
paths-ignore:
- "**/coverage.svg"
env:
CARGO_TERM_COLOR: always
@ -101,6 +105,8 @@ jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
@ -130,8 +136,19 @@ jobs:
- name: Install llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov bc
- name: Run tests with coverage
run: cargo llvm-cov --all-features
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Generate coverage badge
if: github.ref == 'refs/heads/main'
uses: GoogleCloudPlatform/lcov-coverage-badge@5857899449990297b622767f36e4fa8d1218acdb
with:
file: ./lcov.info
icon_name: github
access_token: ${{ secrets.GITHUB_TOKEN }}
security_audit:
name: Security Audit