Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.default]
# Flaky-test management (#489): retry a failing test up to 2 times before
# marking it failed, and report retries so genuinely-flaky tests are visible
# in CI output instead of silently blocking merges.
retries = 2
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,24 @@ jobs:
- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Check formatting
run: cargo fmt --all -- --check

- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run tests
run: cargo test --all-features -- --test-threads=1
# cargo-nextest with retries (.config/nextest.toml, #489): a genuinely-flaky
# test gets retried instead of red-flagging the whole PR, while retries are
# still reported in the run output so real flakiness stays visible.
- name: Run tests (nextest, flaky-retry)
run: cargo nextest run --all-features

# Doctests aren't run by nextest — keep them on plain cargo test.
- name: Run doctests
run: cargo test --doc --all-features

- name: Check documentation
run: cargo doc --no-deps --all-features
Expand All @@ -57,19 +67,28 @@ jobs:
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

# The crate's own logic (DigMessage / DigMessageType / introducer wire types)
# is feature-independent — the `native-tls` / `rustls` features only forward
# TLS re-exports from chia-sdk-client (pure glue with no coverable lines here).
# Measuring default features keeps the gate fast and focused on this crate's code.
# lib.rs is excluded from the floor: it is re-export-only with no own logic.
- name: Run coverage with 80% line floor
#
# Uses the combined `cargo llvm-cov nextest` form (#489) so llvm-cov drives
# nextest directly — coverage instrumentation is still collected AND nextest's
# flaky-retry (.config/nextest.toml) still applies. Running `cargo nextest run`
# and `cargo llvm-cov` as two separate steps collects ZERO coverage from the
# nextest run and fails this gate — do not split them.
- name: Run coverage with 80% line floor (nextest)
run: |
cargo llvm-cov \
cargo llvm-cov nextest \
--ignore-filename-regex 'src/lib\.rs' \
--fail-under-lines 80 \
-- --test-threads=1
--all-features

- name: Coverage summary
if: always()
run: |
cargo llvm-cov report --summary-only -- --test-threads=1
cargo llvm-cov report --summary-only
33 changes: 5 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,14 @@ env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Check formatting
run: cargo fmt --all -- --check

- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run tests
run: cargo test --all-features -- --test-threads=1

- name: Check documentation
run: cargo doc --no-deps --all-features

# No test/lint job here (#489/#488): the PR gates in ci.yml already tested this
# exact tree (branch protection requires up-to-date-with-main + green checks
# before merge), so a tag push re-running the full suite is redundant and was
# a release-blocker (a flaky re-run could fail a release for code already
# proven green on the PR). Publish = build + package + publish only.
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dig-protocol"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["Michael Taylor <michael@berkeleycompute.com>"]
description = "DIG Network L2 protocol types extending Chia's wire protocol (opcodes 200+)"
Expand Down
Loading