Merge pull request #255 from embassy-rs/ci-test
ci: upload generated json diff, and generated data+metapac as artifacts.
This commit is contained in:
commit
2865a53446
28
.github/ci/build.sh
vendored
28
.github/ci/build.sh
vendored
@ -13,4 +13,32 @@ hashtime save /ci/cache/filetime.json
|
|||||||
|
|
||||||
cargo fmt -- --check
|
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
|
./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 <<EOF
|
||||||
|
diff: https://ci.embassy.dev/jobs/$(jq -r .id < /ci/job.json)/artifacts/diff.html
|
||||||
|
EOF
|
||||||
|
2
.github/ci/generated.sh
vendored
2
.github/ci/generated.sh
vendored
@ -12,7 +12,7 @@ export CARGO_TARGET_DIR=/ci/cache/target
|
|||||||
hashtime restore /ci/cache/filetime.json || true
|
hashtime restore /ci/cache/filetime.json || true
|
||||||
hashtime save /ci/cache/filetime.json
|
hashtime save /ci/cache/filetime.json
|
||||||
|
|
||||||
git clone https://github.com/embassy-rs/stm32-data-generated/ build
|
git clone --depth 1 https://github.com/embassy-rs/stm32-data-generated/ build
|
||||||
./d ci
|
./d ci
|
||||||
|
|
||||||
COMMIT=$(git rev-parse HEAD)
|
COMMIT=$(git rev-parse HEAD)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user