Skip to content
Merged

7 #8

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# nextest configuration — https://nexte.st/docs/configuration/
#
# The `ci` profile is used by the Codecov job in `.github/workflows/ci.yml`:
# it emits a JUnit report consumed by Codecov Test Analytics.

[profile.ci.junit]
path = "junit.xml"
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
- name: Check REUSE compliance
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6

coverage:
name: Coverage
codecov:
name: Codecov
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
Expand All @@ -114,12 +114,32 @@ jobs:
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install cargo-llvm-cov
- name: Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 # v2
with:
tool: cargo-llvm-cov
- name: Coverage of hand-written code
tool: cargo-llvm-cov,cargo-nextest
- name: Run tests under coverage instrumentation
run: cargo llvm-cov nextest --all-features --profile ci --no-report
- name: Generate LCOV coverage report
if: ${{ !cancelled() }}
run: >-
cargo llvm-cov --all-features
cargo llvm-cov report --lcov --output-path lcov.info
--ignore-filename-regex 'src/(apis|models)/'
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/ci/junit.xml
- name: Enforce 95% line coverage on hand-written code
if: ${{ !cancelled() }}
run: >-
cargo llvm-cov report --fail-under-lines 95
--ignore-filename-regex 'src/(apis|models)/'
--fail-under-lines 95
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/.claude
/lcov.info
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![crates.io](https://img.shields.io/crates/v/timeweb-rs.svg)](https://crates.io/crates/timeweb-rs)
[![docs.rs](https://img.shields.io/docsrs/timeweb-rs)](https://docs.rs/timeweb-rs)
[![CI](https://github.com/RAprogramm/timeweb-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/RAprogramm/timeweb-rs/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/RAprogramm/timeweb-rs/graph/badge.svg?token=iKNwLuK8au)](https://codecov.io/gh/RAprogramm/timeweb-rs)
[![MSRV](https://img.shields.io/badge/MSRV-1.95-blue.svg)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Expand Down
23 changes: 23 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codecov configuration — https://docs.codecov.com/docs/codecov-yaml
#
# Generated `src/apis` and `src/models` are excluded from coverage; only the
# hand-written layer is measured. The CI `codecov` job enforces the hard 95%
# line gate — the status checks below add per-PR feedback and comments.

coverage:
status:
project:
default:
target: 95%
threshold: 1%
patch:
default:
target: 95%

comment:
layout: "condensed_header, diff, flags, files"
require_changes: false

ignore:
- "src/apis"
- "src/models"
Loading