mirror of
https://github.com/storytold/filmcraft.git
synced 2026-11-07 12:12:37 +00:00
ci(xtask): print the i18n report without recompiling the workspace (#3821)
* ci(xtask): print the i18n report without recompiling the workspace `cargo test -p filmcraft-ui-egui` resolves features for that package alone, so after the workspace test run it recompiled for about 3 minutes (22:16:39 to 22:19:43 in run 41245944744). In `ci` the report now selects the workspace as the test run did and reuses its build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(xtask): i18n report selects the test run's targets too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> The test run builds --lib --bins --tests; a binary target's dependencies (the desktop app's eframe features) could still resolve differently under --lib alone. Match the selection exactly, and drop --quiet so a rebuild would show in the log. --------- Co-authored-by: FredApps <FredApps@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
FredApps
Claude Opus 5.5
parent
95cf47b883
commit
7e17c70466
+9
-6
@@ -493,7 +493,7 @@ fn ci() -> Result<(), String> {
|
||||
run(Command::new(cargo).args(["fmt", "--check"]))?;
|
||||
run(Command::new(cargo).args(["clippy", "--workspace", "--all-targets", "--", "-D", "warnings"]))?;
|
||||
let tested = tests();
|
||||
i18n_report();
|
||||
i18n_report(true);
|
||||
tested?;
|
||||
layers()?;
|
||||
assets()?;
|
||||
@@ -517,10 +517,13 @@ fn tests() -> Result<(), String> {
|
||||
|
||||
/// The missing-translations report (`i18n::tests::missing_translations_report` in
|
||||
/// `filmcraft-ui-egui`), printed to the log. A missing translation never fails a build, so
|
||||
/// neither does this.
|
||||
fn i18n_report() {
|
||||
let args = ["test", "-p", "filmcraft-ui-egui", "--lib", "--", "--exact", "i18n::tests::missing_translations_report", "--nocapture"];
|
||||
if let Err(e) = run(Command::new(env!("CARGO")).args(args)) {
|
||||
/// neither does this. After `tests`, `workspace` selects the packages and targets the test run
|
||||
/// did, so it reuses that build: `-p filmcraft-ui-egui --lib` alone resolves features differently
|
||||
/// and recompiled for about 3 minutes.
|
||||
fn i18n_report(workspace: bool) {
|
||||
let selection: &[&str] = if workspace { &["--workspace", "--lib", "--bins", "--tests"] } else { &["-p", "filmcraft-ui-egui", "--lib"] };
|
||||
let filter = ["--", "--exact", "i18n::tests::missing_translations_report", "--nocapture"];
|
||||
if let Err(e) = run(Command::new(env!("CARGO")).arg("test").args(selection).args(filter)) {
|
||||
eprintln!("i18n report not printed: {e}");
|
||||
}
|
||||
}
|
||||
@@ -554,7 +557,7 @@ fn main() -> ExitCode {
|
||||
"fixtures" => fixtures(&std::env::args().skip(2).collect::<Vec<_>>()),
|
||||
"ci" => ci(),
|
||||
"i18n-report" => {
|
||||
i18n_report();
|
||||
i18n_report(false);
|
||||
Ok(())
|
||||
}
|
||||
"bench" => bench(),
|
||||
|
||||
Reference in New Issue
Block a user