From e54c3d70de7c1f4b8fd3ad3cb1a33955612ca0a2 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 2 Jul 2023 13:32:11 +0200 Subject: [PATCH 1/3] Automatically commit build results to the stm32-data-generated repo. --- .github/ci/generated.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 .github/ci/generated.sh diff --git a/.github/ci/generated.sh b/.github/ci/generated.sh new file mode 100755 index 0000000..098244e --- /dev/null +++ b/.github/ci/generated.sh @@ -0,0 +1,23 @@ +#!/bin/bash +## on push branch=main +## permission contents write +## permission_repo stm32-data-generated + +set -euxo pipefail + +export RUSTUP_HOME=/ci/cache/rustup +export CARGO_HOME=/ci/cache/cargo +export CARGO_TARGET_DIR=/ci/cache/target + +hashtime restore /ci/cache/filetime.json || true +hashtime save /ci/cache/filetime.json + +git clone https://github.com/embassy-rs/stm32-data-generated/ build +./d ci + +COMMIT=$(git rev-parse HEAD) +cd build +git add data stm32-metapac +git commit -m "Generated from stm32-data $COMMIT" +git tag -a stm32-data-$COMMIT -m "Generated from stm32-data $COMMIT" +git push --follow-tags \ No newline at end of file From 6cc7497a33ad7256491c6d58d4de5f7b5eb894b5 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 2 Jul 2023 15:42:12 +0200 Subject: [PATCH 2/3] Update chiptool, makes PAC generation repeatable. --- Cargo.lock | 2 +- stm32-data-gen/Cargo.toml | 2 +- stm32-metapac-gen/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5842a0..422156a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chiptool" version = "0.1.0" -source = "git+https://github.com/embassy-rs/chiptool?rev=d29063045446448526e3e0c19857f10e32992386#d29063045446448526e3e0c19857f10e32992386" +source = "git+https://github.com/embassy-rs/chiptool?rev=0621765f915cedb0a9242a888c1909374ebbf4fa#0621765f915cedb0a9242a888c1909374ebbf4fa" dependencies = [ "anyhow", "clap", diff --git a/stm32-data-gen/Cargo.toml b/stm32-data-gen/Cargo.toml index d087d04..03ba382 100644 --- a/stm32-data-gen/Cargo.toml +++ b/stm32-data-gen/Cargo.toml @@ -17,7 +17,7 @@ quick-xml = { version = "0.26.0", features = ["serialize"] } regex = "1.7.1" serde = { version = "1.0.157", features = ["derive"] } serde_yaml = "0.9.19" -chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "d29063045446448526e3e0c19857f10e32992386" } +chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "0621765f915cedb0a9242a888c1909374ebbf4fa" } serde_json = "1.0.94" rayon = { version = "1.7.0", optional = true } stm32-data-serde = { version = "0.1.0", path = "../stm32-data-serde" } diff --git a/stm32-metapac-gen/Cargo.toml b/stm32-metapac-gen/Cargo.toml index 25d18dc..fb598a7 100644 --- a/stm32-metapac-gen/Cargo.toml +++ b/stm32-metapac-gen/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] regex = "1.7.1" -chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "d29063045446448526e3e0c19857f10e32992386" } +chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "0621765f915cedb0a9242a888c1909374ebbf4fa" } serde = { version = "1.0.157", features = [ "derive" ] } serde_json = "1.0.94" proc-macro2 = "1.0.52" From 9813a029446305811e3973a27c8ff5f9d718f4ff Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 2 Jul 2023 15:42:33 +0200 Subject: [PATCH 3/3] rustfmt the generated pac. --- d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/d b/d index acb155e..035606c 100755 --- a/d +++ b/d @@ -42,7 +42,9 @@ case "$CMD" in rm -rf build/{data,stm32-metapac} cargo run --release --bin stm32-data-gen cargo run --release --bin stm32-metapac-gen - (cd build/stm32-metapac && cargo check --features stm32h755zi-cm7,pac,metadata) + cd build/stm32-metapac + find . -name '*.rs' -not -path '*target*' | xargs rustfmt --skip-children --unstable-features --edition 2021 + cargo check --features stm32h755zi-cm7,pac,metadata ;; *) echo "unknown command"