Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve toolchain installation random issue in CI #647

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/integration-tdx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
system_compile:
name: Run TDX Integration Test
runs-on: [self-hosted, tdx]
timeout-minutes: 30
timeout-minutes: 45

steps:
# Install first since it's needed to build NASM
Expand All @@ -34,12 +34,7 @@ jobs:
submodules: recursive

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rust-src, llvm-tools-preview
run: bash sh_script/update_toolchain.sh ${{ env.RUST_TOOLCHAIN }}

- name: Run cargo install cargo-xbuild
uses: actions-rs/cargo@v1
Expand Down
26 changes: 26 additions & 0 deletions sh_script/update_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

TOOLCHAIN_VER=$1
TRY_TIMES=5
echo ${TOOLCHAIN_VER}

while [ ${TRY_TIMES} -gt 0 ]
do
exist=`rustup toolchain list | grep ${TOOLCHAIN_VER} | wc -l`
if [[ ${exist} == 0 ]]
then
rustup toolchain install ${TOOLCHAIN_VER} --component rust-src
else
rustup component add rust-src
echo "Toolchain ${TOOLCHAIN_VER} is installed."
break
fi
sleep 30
let "TRY_TIMES--"
done

if [[ ${TRY_TIMES} == 0 ]]
then
echo "Install toolchian ${TOOLCHAIN_VER} failed."
exit 1
fi
Loading