feat: provide way to build and attach platforms
Pipeline / check (push) Successful in 1m56s
Pipeline / release (push) Skipped
Pipeline / docs (push) Successful in 1m47s
Pipeline / nightly (push) Successful in 6m41s

This commit is contained in:
2026-08-08 11:46:15 -04:00
parent fdc53ae210
commit 3a7a0d5873
12 changed files with 230 additions and 81 deletions
+76 -45
View File
@@ -5,66 +5,97 @@ authors = ["Scientific Computing Studio <opensource@scient.ing>"]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64"]
[dependencies]
rust = ">=1.96.0,<1.97"
c-compiler = "*"
pkg-config = "*"
[tasks]
# --- Build and run ---
build = { cmd = "cargo build --release", description = "Compile the release binary at target/release/coursebank" }
debug = { cmd = "cargo build", description = "Compile the debug binary" }
build-lean = { cmd = "cargo build --release --no-default-features", description = "Release build without the parquet feature" }
install = { cmd = "cargo install --path . --locked", description = "Install the coursebank binary onto your PATH" }
clean = { cmd = "cargo clean", description = "Remove the target directory" }
cb = { cmd = "cargo run --release --quiet --", description = "Run the CLI, e.g., `pixi run cb validate -C path/to/course`" }
# --- Quality gate ---
format = { cmd = "cargo fmt --all", description = "Reformat the source in place" }
fmt-check = { cmd = "cargo fmt --all --check", description = "Fail if the source is not formatted; does not rewrite" }
lint = { cmd = "cargo clippy --all-targets -- -D warnings", description = "Run clippy with warnings treated as errors" }
tests = { cmd = "cargo test", description = "Run all tests: unit, integration, and doctests" }
doctests = { cmd = "cargo test --doc", description = "Run only the documentation examples" }
check-docs = { cmd = "cargo test --test docs", description = "Check that included markdown fences declare a language" }
check = { depends-on = ["fmt-check", "lint", "tests", "doctests", "check-docs", "doc-build"], description = "Full verify-only gate: formatting, lint, tests, and doc build" }
# --- Documentation ---
doc = { cmd = "cargo doc --no-deps --open", depends-on = ["check-docs"], description = "Build the API docs and open them in a browser" }
doc-build = { cmd = "cargo doc --no-deps", depends-on = ["check-docs"], description = "Build the API docs without opening a browser" }
# --- Release packaging ---
setup-tools = { cmd = "cargo install cargo-about --locked --features cli", description = "Install cargo-about, which the licenses task needs" }
licenses = { cmd = "cargo about generate about.hbs -o THIRD-PARTY-LICENSES.txt", description = "Regenerate THIRD-PARTY-LICENSES.txt" }
dist = { cmd = "mkdir -p dist && cp target/release/coursebank dist/ && cp LICENSE.md THIRD-PARTY-LICENSES.txt dist/", depends-on = ["build", "licenses"], description = "Assemble a release bundle (binary and license notices) in dist/" }
[environments]
dev = ["dev"]
docs = ["docs"]
release = ["release"]
# Developer tooling: editor support, a debugger, a faster test runner, and a
# file watcher.
[dependencies]
rust = ">=1.96.0,<1.97"
c-compiler = "*"
pkg-config = "*"
# --- Build and run ---
[tasks.build]
description = "Compile the release binary at target/release/coursebank"
cmd = "cargo build --release"
[tasks.debug]
description = "Compile the debug binary"
cmd = "cargo build"
[tasks.build-lean]
description = "Release build without the parquet feature"
cmd = "cargo build --release --no-default-features"
[tasks.install]
description = "Install the coursebank binary onto your PATH"
cmd = "cargo install --path . --locked"
[tasks.clean]
description = "Remove the target directory"
cmd = "cargo clean"
[tasks.cb]
description = "Run the CLI, e.g., `pixi run cb validate -C path/to/course`"
cmd = "cargo run --release --quiet --"
# --- Quality gate ---
[tasks.format]
description = "Reformat the source in place"
cmd = "cargo fmt --all"
[tasks.fmt-check]
description = "Fail if the source is not formatted; does not rewrite"
cmd = "cargo fmt --all --check"
[tasks.lint]
description = "Run clippy with warnings treated as errors"
cmd = "cargo clippy --all-targets -- -D warnings"
[tasks.tests]
description = "Run all tests: unit, integration, and doctests"
cmd = "cargo test"
[tasks.doctests]
description = "Run only the documentation examples"
cmd = "cargo test --doc"
[tasks.check-docs]
description = "Check that included markdown fences declare a language"
cmd = "cargo test --test docs"
[tasks.check]
description = "Full verify-only gate: formatting, lint, tests, and doc build"
depends-on = ["fmt-check", "lint", "tests", "doctests", "check-docs", "doc-build"]
# --- Documentation ---
[tasks.doc]
description = "Build the API docs and open them in a browser"
depends-on = ["check-docs"]
cmd = "cargo doc --no-deps --open"
[tasks.doc-build]
description = "Build the API docs without opening a browser"
depends-on = ["check-docs"]
cmd = "cargo doc --no-deps"
# --- Release packaging ---
[tasks.setup-tools]
description = "Install cargo-about, which the licenses task needs"
cmd = "cargo install cargo-about --locked --features cli"
[tasks.licenses]
description = "Regenerate THIRD-PARTY-LICENSES.txt"
cmd = "cargo about generate about.hbs -o THIRD-PARTY-LICENSES.txt"
[tasks.dist]
description = "Assemble a release bundle (binary and license notices) in dist/"
cmd = "mkdir -p dist && cp target/release/coursebank dist/ && cp LICENSE.md THIRD-PARTY-LICENSES.txt dist/"
depends-on = ["build", "licenses"]
[feature.dev.dependencies]
rust-analyzer = "*"
lldb = "*"
cargo-nextest = "*"
[feature.dev.tasks]
nextest = { cmd = "cargo nextest run", description = "Run the test suite with nextest" }
[feature.dev.tasks.nextest]
description = "Run the test suite with nextest"
cmd = "cargo nextest run"
# Typst is only needed to typeset exported .typ files by hand. The exporter
# writes .typ on its own and does not require typst to be installed.
[feature.docs.dependencies]
typst = "*"
[feature.docs.tasks]
typeset = { cmd = "typst compile", description = "Compile a .typ file to PDF" }
[feature.docs.tasks.typeset]
description = "Compile a .typ file to PDF"
cmd = "typst compile"
# Release tooling, kept in its own environment so the default and dev
# environments do not pull in Python. bump-my-version reads .bumpversion.toml,
# which encodes the YY.MM.PATCH scheme.
[feature.release.dependencies]
bump-my-version = "*"