mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-19 05:50:43 +01:00
Updating CI with local profile for faster runs (#453)
* Run CI on stable Rust and check layering earlier * Add a faster profile for optimized verification
This commit is contained in:
1 parent
feb2a83b85
commit
a03f14ea88
4 files changed
+35
-3
No files matched your search
@@ -24,7 +24,6 @@ jobs:
|
||||
# Same craft-fonts commit as release.yml.
|
||||
craft-fonts-ref: aced4137c022f1f587624d48e81ec77e1914a9cc
|
||||
os: '["ubuntu-24.04","windows-latest"]'
|
||||
toolchain: "1.96.0"
|
||||
# xtask ci runs cargo test (including doctests), not cargo nextest.
|
||||
tools: ""
|
||||
packages: >-
|
||||
|
||||
@@ -117,6 +117,13 @@ opt-level = 1
|
||||
lto = "thin"
|
||||
codegen-units = 1
|
||||
|
||||
# Fast optimized verification: each test executable otherwise repeats cross-crate LTO.
|
||||
# `false` keeps thin LTO within each crate; release packaging keeps the profile above.
|
||||
[profile.verify]
|
||||
inherits = "release"
|
||||
lto = false
|
||||
codegen-units = 16
|
||||
|
||||
[profile.wasm-release]
|
||||
inherits = "release"
|
||||
opt-level = "s"
|
||||
|
||||
@@ -12,6 +12,31 @@ Run a feature module with a test-name filter, for example:
|
||||
cargo test -p texturecraft-engine --test it bake::
|
||||
```
|
||||
|
||||
For faster optimized local verification, run the same workspace tests and doctests
|
||||
with the `verify` profile:
|
||||
|
||||
```sh
|
||||
cargo test --workspace --profile verify
|
||||
```
|
||||
|
||||
`verify` inherits the release profile's optimization level and runtime checks, but
|
||||
uses 16 codegen units and `lto = false`. Cargo retains thin LTO within each crate
|
||||
without repeating cross-crate LTO for every test executable. The existing test
|
||||
selection and ignore attributes still apply. Keep the target directory between
|
||||
runs so Cargo can reuse unchanged build artifacts.
|
||||
|
||||
To compile the normal application binaries alongside the test binaries before
|
||||
running them:
|
||||
|
||||
```sh
|
||||
cargo build --workspace --bins --tests --profile verify
|
||||
cargo test --workspace --profile verify
|
||||
```
|
||||
|
||||
This profile is for local verification. Use `--release` for release validation and
|
||||
performance measurements; its compiler settings remain unchanged. The regular
|
||||
debug test profile and CI gates also remain unchanged.
|
||||
|
||||
The standalone engine `session` target and UI `ui_snapshots` target remain
|
||||
available for the commands in `AGENTS.md`. Existing ignore attributes are
|
||||
unchanged. Tests in the shared executable can run concurrently across modules;
|
||||
|
||||
+3
-2
@@ -15,7 +15,7 @@ usage: cargo xtask <command>
|
||||
commands:
|
||||
layers enforce the crate dependency layering (xtask/src/layers.rs)
|
||||
wasm cargo check --target wasm32-unknown-unknown for the wasm crates and the web app
|
||||
ci fmt --check, clippy -D warnings, test, layers, wasm (stops at the first failure)
|
||||
ci fmt --check, layers, clippy -D warnings, test, wasm (stops at the first failure)
|
||||
version [set X.Y.Z[-pre]]
|
||||
print the workspace version, or set it (Cargo.toml + Cargo.lock)
|
||||
ico <out.ico> <in.png>...
|
||||
@@ -154,11 +154,12 @@ fn cmd_ci() -> Result<(), String> {
|
||||
}
|
||||
};
|
||||
type Step = (&'static str, Box<dyn Fn() -> Result<(), String>>);
|
||||
// Reject invalid dependency layering before spending time compiling and running the workspace.
|
||||
let steps: Vec<Step> = vec![
|
||||
("fmt", Box::new(cargo_step(&["fmt", "--all", "--", "--check"]))),
|
||||
("layers", Box::new(cmd_layers)),
|
||||
("clippy", Box::new(cargo_step(&["clippy", "--workspace", "--all-targets", "--", "-D", "warnings"]))),
|
||||
("test", Box::new(cargo_step(&["test", "--workspace"]))),
|
||||
("layers", Box::new(cmd_layers)),
|
||||
("wasm", Box::new(cmd_wasm)),
|
||||
];
|
||||
for (i, (name, step)) in steps.iter().enumerate() {
|
||||
|
||||
Reference in new issue
Block a user