Optimize release-build.yml: Avoid building benchmark dependencies (#981)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-04-06 16:19:15 +10:00 committed by GitHub
parent 0de3b21004
commit f134df548d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -220,7 +220,7 @@ fmt-check: fmt
lint: clippy fmt-check
# Some dev-dependencies require a newer version of Rust, but it doesn't matter for MSRV check
# Rm dev-dependencies for `cargo-check` and clippy to speedup compilation.
# This is a workaround for the cargo nightly option `-Z avoid-dev-deps`
avoid-dev-deps:
for crate in ./crates/*; do \
@ -228,6 +228,12 @@ avoid-dev-deps:
mv "$crate/Cargo.toml.tmp" "$crate/Cargo.toml" \
; done
# leon dev-dependencies pulls in crates for benchmark but not used in test.
# This is a workaround for the lack of `benchmark-dependencies`.
avoid-benchmark-deps:
sed 's/\[dev-dependencies\]/[workaround-avoid-dev-deps]/g' ./crates/leon/Cargo.toml >./crates/leon/Cargo.toml.tmp
mv ./crates/leon/Cargo.toml.tmp ./crates/leon/Cargo.toml
package-dir:
rm -rf packages/prep
mkdir -p packages/prep