From b77943a5472aefb514199b3f3f412320539f9fc4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 14 Sep 2023 03:34:04 +0200 Subject: [PATCH] ci: upload generated json diff, and generated data+metapac as artifacts. --- .github/ci/build.sh | 28 ++++++++++++++++++++++++++++ .github/ci/generated.sh | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/ci/build.sh b/.github/ci/build.sh index bdf7490..d9e1478 100755 --- a/.github/ci/build.sh +++ b/.github/ci/build.sh @@ -13,4 +13,32 @@ hashtime save /ci/cache/filetime.json cargo fmt -- --check +# clone stm32-data-generated at the merge base +# so the diff will show this PR's effect +git clone --depth 1 --branch stm32-data-$(git merge-base HEAD main) https://github.com/embassy-rs/stm32-data-generated/ build + ./d ci + +# upload diff +( + cd build + git diff --color data | aha --black > /ci/artifacts/diff.html +) + +# upload generated data to a fake git repo at +# https://ci.embassy.dev/jobs/$ID/artifacts/generated.git +# this allows testing the corresponding embassy-stm32 PR before merging the stm32-data one. +( + cd build + rm -rf .git + git init + git add . + git commit -m 'generated' + git gc # makes cloning faster + git update-server-info # generate .git/info/refs + mv .git /ci/artifacts/generated.git +) + +cat > /ci/comment.md <