Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

ci: i18n report without a rebuild; PR print runs stop saving caches

FredApps2f26d4012b4c
diff --git a/.github/workflows/print.yml b/.github/workflows/print.yml
index 400a81944..b805725f2 100644
--- a/.github/workflows/print.yml
+++ b/.github/workflows/print.yml
@@ -26,9 +26,13 @@ jobs:
with:
toolchain: stable
components: clippy
+ # Pull requests restore but never save: a PR's cache (about 1.3 GB) is visible only to that
+ # PR, and with the repository at its 10 GB limit each one evicted caches main's gate uses.
+ # A manual run on main seeds the cache every PR can restore.
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: desktop-print
+ save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo clippy --locked -p vectorcraft --all-targets -- -D warnings
- run: cargo test --locked -p vectorcraft
- name: Check pending submission and queue refusal feedback
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 0516321ab..efb80daa7 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -294,7 +294,7 @@ fn cmd_ci() -> Result<(), String> {
("assets", Box::new(|| assets::run(&root()))),
("brands", Box::new(|| brands::run(&root()))),
("cursors", Box::new(|| cursors::run(&root()))),
- ("i18n-report", Box::new(cmd_i18n_report)),
+ ("i18n-report", Box::new(cmd_ci_i18n_report)),
("layers", Box::new(cmd_layers)),
("wasm", Box::new(cmd_wasm)),
];
@@ -349,3 +349,12 @@ fn cmd_i18n_report() -> Result<(), String> {
c.args(["test", "-p", "vectorcraft-ui-egui", "--lib", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
run(c, "cargo test -p vectorcraft-ui-egui --lib -- i18n::tests::untranslated_report --exact --nocapture")
}
+
+/// [`cmd_i18n_report`] in `ci`, selecting the whole workspace as the test stage did: with
+/// `-p vectorcraft-ui-egui` alone cargo resolves features differently and recompiled for about
+/// 3.5 minutes. Every other lib test binary runs with no test matching the filter.
+fn cmd_ci_i18n_report() -> Result<(), String> {
+ let mut c = cargo();
+ c.args(["test", "--workspace", "--lib", "--quiet", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
+ run(c, "cargo test --workspace --lib --quiet -- i18n::tests::untranslated_report --exact --nocapture")
+}