Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Merge remote-tracking branch 'upstream/main' into xtask-ci-gate

aiongg4b5164795532
diff --cc .github/workflows/ci.yml
index df23bef70,bf1a9c04a..d729e8b55
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@@ -132,9 -134,23 +132,9 @@@ jobs
PHOTOCRAFT_NO_PRINT=1
LPDEST=photocraft-no-such-printer
timeout-minutes: 100
- # `--features heif`: official builds open HEIC photos via the optional photocraft-heif crate.
- # `--lib --bins --tests` leaves out the examples, which cargo test would build and link but
- # never run (Clippy's `--all-targets` still checks they compile). nextest skips doctests, so
- # they run last. The `ci` profile fails fast and terminates hung tests (.config/nextest.toml).
- # docs/scorecard.md must match its sources; the check reads committed files only.
- # panic_hunt: every command against adversarial params must return Err, never panic or hang
- # (AGENTS.md Rule 9). It is `#[ignore]`d (slow), so the test run skips it; the same packages,
- # features and targets keep it from rebuilding anything.
- command: |
- cargo fmt --all -- --check
- cargo clippy --workspace --all-targets --locked --features heif -- -D warnings
- cargo xtask layers
- cargo xtask scorecard --check
- cargo nextest run --profile ci --workspace --locked --features heif --lib --bins --tests
- cargo nextest run --profile ci --workspace --locked --features heif --lib --bins --tests \
- --run-ignored only -E 'binary_id(photocraft-engine::panic_hunt)'
- cargo test --workspace --locked --features heif --doc
+ # fmt, clippy, layers, scorecard, tests, panic_hunt, doctests and the wasm32 check, with
- # `--locked --features heif` (xtask/src/main.rs).
++ # `--locked --features heif`, then the missing-translations report (xtask/src/main.rs).
+ command: cargo xtask ci
# Windows tests run as two legs in parallel: the unit tests and the integration tests. As one job
# they took ~28 min on the Windows runner; the legs take ~13 and ~15. Splitting the integration
diff --cc docs/development.md
index fb61b4a66,a825a85ba..b4cacd0a6
--- a/docs/development.md
+++ b/docs/development.md
@@@ -40,7 -40,7 +40,7 @@@ cargo run --release -p photocraft -- --
--automation-read-root work --automation-write-root work
cargo test --workspace # everything
cargo xtask test # tests (nextest when installed) + doctests
- cargo xtask ci # the CI gate: fmt, clippy, layers, scorecard, tests, panic_hunt, doctests, wasm
-cargo xtask ci # fmt + clippy + tests + doctests + layers + wasm
++cargo xtask ci # the CI gate: fmt, clippy, layers, scorecard, tests, panic_hunt, doctests, wasm, i18n report
cargo xtask stats # tests and lines per crate
cargo xtask parity # Photoshop menu coverage -> docs/parity-checklist.md
```
diff --cc xtask/src/main.rs
index ad603238f,d6965b48c..545bce9d2
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@@ -26,9 -26,8 +26,9 @@@ commands
wasm cargo check --target wasm32-unknown-unknown for the wasm-safe crates (one call, plus
one per optional web feature)
test workspace tests (cargo nextest when installed, else cargo test), then doctests
- ci fmt --check, clippy -D warnings, test, doctest, layers, wasm (stops at first failure),
- then the i18n-coverage report
+ ci the CI gate: fmt --check, clippy -D warnings, layers, scorecard --check, tests
+ (nextest --profile ci), panic_hunt, doctests and wasm, with --locked --features heif
- (stops at first failure)
++ (stops at first failure), then the i18n-coverage report
corpus [--all | --pngsuite | --psd | --psd-tools | --pixls | --atn | --photoshop | --gimp] [--local] [--update-manifest]
show where test corpora live and their pins (xtask/src/corpus_pins.rs), or fetch
them into corpus/ (pinned commits, sha256-verified; --all = every corpus but pixls,
@@@ -268,23 -243,24 +269,33 @@@ fn cmd_ci() -> Result<(), String>
"clippy",
Box::new(|| {
let mut c = cargo();
- c.args(["clippy", "--workspace", "--all-targets", "--keep-going", "--", "-D", "warnings"]);
- run(c, "cargo clippy --workspace --all-targets --keep-going -- -D warnings")
+ c.arg("clippy").args(GATE_ARGS).args(["--all-targets", "--keep-going", "--", "-D", "warnings"]);
+ run(c, "cargo clippy --workspace --locked --features heif --all-targets --keep-going -- -D warnings")
}),
),
- ("test", Box::new(cmd_test)),
- ("doctest", Box::new(cmd_doctest)),
("layers", Box::new(cmd_layers)),
+ ("scorecard", Box::new(|| scorecard::run(&root(), &["--check"]))),
+ ("test", Box::new(|| cmd_gate_tests(false))),
+ ("panic_hunt", Box::new(|| cmd_gate_tests(true))),
+ (
+ "doctest",
+ Box::new(|| {
+ let mut c = cargo();
+ c.arg("test").args(GATE_ARGS).arg("--doc");
+ run(c, "cargo test --workspace --locked --features heif --doc")
+ }),
+ ),
("wasm", Box::new(cmd_wasm)),
+ (
+ "i18n",
+ Box::new(|| {
+ // Lists missing translations for the log; a missing string shows in English, so it never fails CI.
+ if let Err(e) = i18n_coverage::run(&root()) {
+ eprintln!("warning: i18n coverage report failed: {e}");
+ }
+ Ok(())
+ }),
+ ),
];
let mut done = Vec::new();
for (name, f) in &steps {