mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-25 08:14:12 +00:00
ci: add custom lint for spirv-std
building with -Z minimal-versions
.
This commit is contained in:
parent
791be4b5d7
commit
bc40662167
24
.github/workflows/lint.sh
vendored
24
.github/workflows/lint.sh
vendored
@ -63,3 +63,27 @@ if (
|
|||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 2. Ensure `spirv-std` & helper crates have necessary dependency versions
|
||||||
|
# listed in their `Cargo.toml` files, by using `cargo -Z minimal-versions`.
|
||||||
|
echo 'Testing dependency versions with `cargo -Z minimal-versions`:'
|
||||||
|
|
||||||
|
function version_test() {
|
||||||
|
local crate_path="$1"
|
||||||
|
local crate_name="$(basename "$crate_path")"
|
||||||
|
local test_dir="$(mktemp -d --tmpdir "version-test-$crate_name-XXXXXXXXXX")"
|
||||||
|
local test_cargoflags=(
|
||||||
|
-Z minimal-versions
|
||||||
|
--manifest-path "$test_dir/Cargo.toml"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ::group::"$crate_name (via $test_dir)"
|
||||||
|
cargo init --lib --vcs none --name "version-test-$crate_name" "$test_dir"
|
||||||
|
cargo add "${test_cargoflags[@]}" --path "$crate_path"
|
||||||
|
cargo clippy "${test_cargoflags[@]}" -- -D warnings
|
||||||
|
rm -r "$test_dir"
|
||||||
|
echo ::endgroup::
|
||||||
|
}
|
||||||
|
# FIXME(eddyb) try to get this working for `spirv-builder`, which has a larger
|
||||||
|
# dependency graph, with too much imprecision in upstream `Cargo.toml` files.
|
||||||
|
version_test crates/spirv-std
|
||||||
|
Loading…
Reference in New Issue
Block a user