mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 20:28:28 +00:00
Build the CI archive driver without framework-only lint dependencies (#15963)
* Use the document mutator in the damage-history fixture * Compile the archive driver without framework-only lint dependencies --------- Co-authored-by: FredApps <[email protected]>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
[alias]
|
||||
xtask = "run -p xtask --"
|
||||
# Archive and doctest jobs do not need the framework's lockfile and translation checks.
|
||||
xtask-gate = "run --locked -p xtask --no-default-features -- ci"
|
||||
|
||||
# wgpu's GL backend (glutin_wgl_sys) imports opengl32.dll, so every binary that links wgpu loads
|
||||
# it at start, and a process that has loaded it takes about 60 ms longer to exit (#15444): every
|
||||
|
||||
@@ -192,8 +192,8 @@ jobs:
|
||||
# missing-translations report (`cargo xtask ci lint`, xtask/src/main.rs), and the CI scripts'
|
||||
# own tests.
|
||||
lint-command: python3 scripts/test-ci-gpu-lavapipe.py && python3 scripts/test-ci-windows-gpu-tests.py && python3 scripts/test-ci-test-times.py && cargo xtask ci lint
|
||||
archive-command: cargo xtask ci archive --gpu-shard
|
||||
after-archive-command: cargo xtask ci doctest
|
||||
archive-command: cargo xtask-gate archive --gpu-shard
|
||||
after-archive-command: cargo xtask-gate doctest
|
||||
test-shards: 4
|
||||
shard-archives: true
|
||||
# The tests and panic_hunt with `--locked --features heif` (TEST_TARGETS in xtask/src/main.rs).
|
||||
@@ -243,8 +243,8 @@ jobs:
|
||||
PHOTOCRAFT_CI_EXCLUDE=photocraft-web photocraft-web-boot ${{ needs.platforms.outputs.windows_gpu == 'false' && 'photocraft-gpu' || '' }} ${{ needs.platforms.outputs.windows_skip }}
|
||||
timeout-minutes: 100
|
||||
lint-command: cargo xtask ci clippy
|
||||
archive-command: cargo xtask ci archive
|
||||
after-archive-command: cargo xtask ci doctest
|
||||
archive-command: cargo xtask-gate archive
|
||||
after-archive-command: cargo xtask-gate doctest
|
||||
test-shards: 6
|
||||
shard-archives: true
|
||||
shard-command: bash scripts/ci-test-shard.sh
|
||||
|
||||
+6
-2
@@ -8,6 +8,10 @@ publish = false
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[features]
|
||||
default = ["framework-checks"]
|
||||
framework-checks = ["dep:craft", "dep:craft-i18n"]
|
||||
|
||||
[dependencies]
|
||||
serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
@@ -15,9 +19,9 @@ chrono = { workspace = true }
|
||||
# perf/budgets.toml and scorecard/*.toml (MIT OR Apache-2.0).
|
||||
toml = "1"
|
||||
# `i18n-report` looks the UI strings up in the craft-i18n catalogs as the app does.
|
||||
craft-i18n = { workspace = true }
|
||||
craft-i18n = { workspace = true, optional = true }
|
||||
# `egui-fork` checks Cargo.lock against `craft::egui_fork`.
|
||||
craft = { workspace = true }
|
||||
craft = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
|
||||
+27
-2
@@ -7,6 +7,7 @@ mod cache_units;
|
||||
mod cargo_env;
|
||||
mod corpus;
|
||||
mod corpus_pins;
|
||||
#[cfg(feature = "framework-checks")]
|
||||
mod i18n_report;
|
||||
mod ico;
|
||||
mod layers;
|
||||
@@ -95,7 +96,7 @@ fn main() -> ExitCode {
|
||||
Some("test-corpus") => corpus::test_cmd(&rest),
|
||||
Some("stats") => stats::run(&root(), rest.contains(&"--exact")),
|
||||
Some("parity") => cmd_parity(),
|
||||
Some("i18n-report") => i18n_report::run(&root()),
|
||||
Some("i18n-report") => cmd_i18n_report(),
|
||||
Some("perf") => perf::run(&root(), &rest),
|
||||
Some("scorecard") => scorecard::run(&root(), &rest),
|
||||
Some("version") => version::run(&root(), &rest),
|
||||
@@ -151,6 +152,7 @@ pub fn target_dir() -> Result<PathBuf, String> {
|
||||
|
||||
/// Two egui revisions in one build give two incompatible `Ui` types, so the workspace's egui
|
||||
/// `[patch]` must name the revision the craft framework is built with.
|
||||
#[cfg(feature = "framework-checks")]
|
||||
fn cmd_egui_fork() -> Result<(), String> {
|
||||
let path = root().join("Cargo.lock");
|
||||
let lock = std::fs::read_to_string(&path).map_err(|e| format!("{}: {e}", path.display()))?;
|
||||
@@ -159,6 +161,29 @@ fn cmd_egui_fork() -> Result<(), String> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "framework-checks")]
|
||||
fn cmd_i18n_report() -> Result<(), String> {
|
||||
i18n_report::run(&root())
|
||||
}
|
||||
|
||||
// An explicitly minimal xtask can still run either check when asked for it.
|
||||
#[cfg(not(feature = "framework-checks"))]
|
||||
fn run_framework_check(name: &str) -> Result<(), String> {
|
||||
let mut c = cargo();
|
||||
c.args(["run", "--locked", "-p", "xtask", "--features", "framework-checks", "--", name]);
|
||||
run(c, name)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "framework-checks"))]
|
||||
fn cmd_egui_fork() -> Result<(), String> {
|
||||
run_framework_check("egui-fork")
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "framework-checks"))]
|
||||
fn cmd_i18n_report() -> Result<(), String> {
|
||||
run_framework_check("i18n-report")
|
||||
}
|
||||
|
||||
fn cmd_layers() -> Result<(), String> {
|
||||
let crates = layers::from_metadata(&metadata()?)?;
|
||||
println!("Dependency layering (docs/architecture.md §3)\n");
|
||||
@@ -364,7 +389,7 @@ fn step_doctest(o: &CiOptions) -> Result<(), String> {
|
||||
|
||||
fn step_i18n(_: &CiOptions) -> Result<(), String> {
|
||||
// Lists missing translations for the log; a missing string shows in English, so it never fails CI.
|
||||
if let Err(e) = i18n_report::run(&root()) {
|
||||
if let Err(e) = cmd_i18n_report() {
|
||||
eprintln!("warning: i18n report failed: {e}");
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user