Skip to content

Commit

Permalink
ci: Improve robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 27, 2024
1 parent cf9e9a1 commit 5c5729a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,23 @@ jobs:
sync_files: runner-to-vm
run: |
set -CeEuxo pipefail
retry() {
for i in {1..10}; do
if "$@"; then
return 0
else
sleep "${i}"
fi
done
"$@"
}
export CI=true
export RUSTFLAGS="${RUSTFLAGS} --cfg qemu"
# AArch64 FreeBSD/NetBSD/OpenBSD are tier 3 targets, so install Rust from package manager instead of rustup.
case "$(uname -s)" in
FreeBSD) sudo pkg install -y rust ;;
NetBSD) sudo pkgin -y install rust ;;
OpenBSD) sudo pkg_add rust ;;
FreeBSD) retry sudo pkg install -y rust ;;
NetBSD) retry sudo pkgin -y install rust ;;
OpenBSD) retry sudo pkg_add rust ;;
esac
rustc -vV
# VM is very slow, so only test OS-specific code and code using them.
Expand Down

0 comments on commit 5c5729a

Please sign in to comment.