File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,12 +41,19 @@ jobs:
4141 test :
4242 name : Test
4343 runs-on : ubuntu-latest
44+ permissions :
45+ contents : write
4446 steps :
4547 - name : Checkout code
4648 uses : actions/checkout@v4
4749
4850 - name : Setup Rust toolchain
4951 uses : dtolnay/rust-toolchain@stable
52+ with :
53+ components : llvm-tools-preview
54+
55+ - name : Install cargo-llvm-cov
56+ uses : taiki-e/install-action@cargo-llvm-cov
5057
5158 - name : Cache cargo
5259 uses : actions/cache@v4
5966 restore-keys : |
6067 ${{ runner.os }}-cargo-test-
6168
62- - name : Run tests
63- run : cargo test --verbose --workspace
69+ - name : Run tests with coverage
70+ run : cargo llvm-cov --workspace --json --output-path coverage.json --summary-only
71+
72+ - name : Convert coverage to json-summary format
73+ run : |
74+ COVERAGE=$(cat coverage.json | jq '.data[0].totals.lines.percent')
75+ echo "{\"total\":{\"lines\":{\"pct\":$COVERAGE}}}" > coverage-summary.json
76+
77+ - name : Update Coverage Badge
78+ if : github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
79+ uses : we-cli/coverage-badge-action@main
6480
6581 clippy :
6682 name : Clippy
Original file line number Diff line number Diff line change 55** Distributed validator network for decentralized AI evaluation on Bittensor**
66
77[ ![ CI] ( https://github.com/PlatformNetwork/platform/actions/workflows/ci.yml/badge.svg )] ( https://github.com/PlatformNetwork/platform/actions/workflows/ci.yml )
8+ [ ![ Coverage] ( https://platformnetwork.github.io/platform/badges/coverage.svg )] ( https://github.com/PlatformNetwork/platform/actions )
89[ ![ License] ( https://img.shields.io/github/license/PlatformNetwork/platform )] ( https://github.com/PlatformNetwork/platform/blob/main/LICENSE )
910[ ![ GitHub stars] ( https://img.shields.io/github/stars/PlatformNetwork/platform )] ( https://github.com/PlatformNetwork/platform/stargazers )
1011[ ![ Rust] ( https://img.shields.io/badge/rust-1.90+-orange.svg )] ( https://www.rust-lang.org/ )
You can’t perform that action at this time.
0 commit comments