Skip to content

Commit 8c801a8

Browse files
committed
Fixed workflows added coverage workflow
1 parent e1eca6a commit 8c801a8

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,25 @@ on:
77

88
jobs:
99
build-test:
10-
name: fmt • clippy • test • doc • linux/macos/windows
10+
name: fmt • clippy • test • doc • ${{ matrix.os }}
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616

17+
env:
18+
CARGO_TERM_COLOR: always
19+
CARGO_INCREMENTAL: 0
20+
1721
steps:
1822
- name: Checkout
1923
uses: actions/checkout@v4
2024

21-
- name: Install Rust (stable)
25+
- name: Install Rust (stable + components)
2226
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
components: rustfmt, clippy
2329

2430
- name: Cache cargo
2531
uses: Swatinem/rust-cache@v2

.github/workflows/coverage.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Coverage
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
llvm-cov:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: dtolnay/rust-toolchain@stable
14+
- uses: Swatinem/rust-cache@v2
15+
16+
- name: Install cargo-llvm-cov
17+
uses: taiki-e/install-action@v2
18+
with:
19+
tool: cargo-llvm-cov
20+
21+
- name: Run coverage (HTML + lcov)
22+
run: |
23+
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
24+
cargo llvm-cov --all-features --workspace --html --output-path target/llvm-cov/html
25+
26+
- name: Upload HTML coverage artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: coverage-html
30+
path: target/llvm-cov/html
31+
if-no-files-found: error

.pre-commit-config.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
repos:
2-
# General hygiene
32
- repo: https://github.com/pre-commit/pre-commit-hooks
43
rev: v4.6.0
54
hooks:
@@ -8,7 +7,6 @@ repos:
87
- id: check-yaml
98
- id: check-merge-conflict
109

11-
# Rust hooks (local) — use your installed toolchain
1210
- repo: local
1311
hooks:
1412
- id: rustfmt
@@ -25,7 +23,7 @@ repos:
2523
pass_filenames: false
2624
stages: [commit]
2725

28-
# Keep tests fast at commit time; run full tests on pre-push
26+
# run tests on push (keeps commits fast, pushes safe)
2927
- id: cargo-test-quick
3028
name: cargo test (quick)
3129
entry: bash -lc 'cargo test --all-features --quiet'

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# rust-toolchain.toml
2+
[toolchain]
3+
channel = "stable"
4+
components = ["rustfmt", "clippy"]
5+
profile = "minimal"

0 commit comments

Comments
 (0)