Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for include_dir #248

Merged
merged 6 commits into from
Dec 25, 2024
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
33 changes: 20 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ jobs:
run: cargo clippy --all-features --all-targets
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Install cargo readme
- name: Install cargo-sync-rdme and just
uses: taiki-e/install-action@8484225d9734e230a8bf38421a4ffec1cc249372 # v2
with:
tool: cargo-readme
- name: Run cargo readme
run: ./scripts/regenerate-readmes.sh
tool: cargo-sync-rdme,just
- name: Install nightly toolchain for cargo-sync-rdme
uses: dtolnay/rust-toolchain@nightly
- name: Generate readmes
run: just generate-readmes
- name: Check for differences
run: git diff --exit-code

Expand Down Expand Up @@ -68,24 +70,29 @@ jobs:
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
with:
key: ${{ matrix.rust-version }}
- name: Install tools
uses: taiki-e/install-action@8484225d9734e230a8bf38421a4ffec1cc249372 # v2
with:
tool: cargo-hack,just,nextest
- name: Build
run: cargo build
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Build datatest-stable
run: cargo build
run: just powerset build
- name: Build with all targets
run: just powerset build --all-targets
- name: Run tests
run: cargo nextest run
run: just powerset nextest run
- name: Run tests with cargo test
run: cargo test
run: just powerset test

# Remove Cargo.lock to ensure that building with the latest versions works on stable.
- name: Remove Cargo.lock and rebuild on stable
if: matrix.rust-version == 'stable'
run: rm Cargo.lock && cargo build
- name: Build with all targets
if: matrix.rust-version == 'stable'
run: just powerset build --all-targets
- name: Run tests on stable
if: matrix.rust-version == 'stable'
run: cargo nextest run
run: just powerset nextest run
- name: Run tests with cargo test on stable
if: matrix.rust-version == 'stable'
run: cargo test
run: just powerset test
13 changes: 5 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@ jobs:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2

- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install tools
uses: taiki-e/install-action@8484225d9734e230a8bf38421a4ffec1cc249372 # v2
with:
tool: cargo-llvm-cov,just,nextest

- name: Collect coverage data
# Generate separate reports for nextest and doctests, and combine them.
run: |
cargo llvm-cov --no-report nextest
cargo llvm-cov --no-report --doc
cargo llvm-cov report --doctests --lcov --output-path lcov.info
just coverage --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5
env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: dtolnay/rust-toolchain@stable
- name: Build rustdocs
run: ./scripts/build-docs.sh
- uses: taiki-e/install-action@just
- name: Build rustdoc
run: just rustdoc
- name: Organize
run: |
rm -rf target/gh-pages
Expand Down
20 changes: 20 additions & 0 deletions Cargo.lock

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

21 changes: 21 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,27 @@ categories = ["development-tools::testing"]
keywords = ["datatest", "data-driven-tests", "test-harness"]
rust-version = "1.72"

[badges]
maintenance = { status = "passively-maintained" }

[package.metadata.cargo-sync-rdme.badge.badges]
maintenance = true
license = true
crates-io = true
docs-rs = true
rust-version = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg=doc_cfg"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }

[dependencies]
camino = "1.1.9"
fancy-regex = "0.14.0"
include_dir = { version = "0.7.4", optional = true }
libtest-mimic = "0.8.1"
walkdir = "2.5.0"

Expand All @@ -28,3 +46,6 @@ harness = false
[[test]]
name = "run_example"
harness = true

[features]
include-dir = ["dep:include_dir"]
25 changes: 25 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Print a help message.
help:
just --list


# Run `cargo hack --feature-powerset` with the given arguments.
powerset *args:
cargo hack --feature-powerset {{args}}

# Build docs for crates and direct dependencies
rustdoc:
@cargo tree --depth 1 -e normal --prefix none --workspace \
| gawk '{ gsub(" v", "@", $0); printf("%s\n", $1); }' \
| xargs printf -- '-p %s\n' \
| RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS='--cfg=doc_cfg' xargs cargo doc --no-deps --lib --all-features

# Generate README.md files using `cargo-sync-rdme`.
generate-readmes:
cargo sync-rdme --toolchain nightly --all-features

# Collect coverage, pass in `--html` to get an HTML report
coverage *args:
cargo +nightly llvm-cov --no-report nextest --all-features
cargo +nightly llvm-cov --no-report --doc --all-features
cargo +nightly llvm-cov report --doctests {{args}}
Loading
Loading