Enable running ci.sh locally multiple-times.

This commit is contained in:
Matous Hybl 2021-12-08 12:33:41 +01:00
parent 8ad8e3b718
commit bdde4dc966
2 changed files with 13 additions and 1 deletions

4
.gitignore vendored
View File

@ -4,3 +4,7 @@ Cargo.lock
third_party third_party
/Cargo.toml /Cargo.toml
stm32-metapac-gen/out/ stm32-metapac-gen/out/
stm32-metapac-backup
stm32-metapac/src/chips
stm32-metapac/src/peripherals
out/

10
ci.sh
View File

@ -6,9 +6,17 @@ export CARGO_TARGET_DIR=$PWD/target_ci
export RUSTFLAGS=-Dwarnings export RUSTFLAGS=-Dwarnings
export DEFMT_LOG=trace export DEFMT_LOG=trace
find . -name '*.rs' -not -path '*target*' -not -path '*stm32-metapac-gen/out/*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 find . -name '*.rs' -not -path '*target*' -not -path '*stm32-metapac-gen/out/*' -not -path '*stm32-metapac/src/*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018
# Generate stm32-metapac # Generate stm32-metapac
if [ ! -d "stm32-metapac-backup" ]
then
cp -r stm32-metapac stm32-metapac-backup
fi
rm -rf stm32-metapac
cp -r stm32-metapac-backup stm32-metapac
# for some reason Cargo stomps the cache if we don't specify --target. # for some reason Cargo stomps the cache if we don't specify --target.
# This happens with vanilla Cargo, not just cargo-batch. Bug? # This happens with vanilla Cargo, not just cargo-batch. Bug?
(cd stm32-metapac-gen; cargo run --release --target x86_64-unknown-linux-gnu) (cd stm32-metapac-gen; cargo run --release --target x86_64-unknown-linux-gnu)