Skip to content

Commit e42e116

Browse files
authored
Backport some CI network reliability changes (#12011)
This backports a blending of #10808 and #11532 to the 24.0.x release branch to try and make CI a bit more reliable.
1 parent 33be094 commit e42e116

File tree

4 files changed

+35
-8
lines changed

4 files changed

+35
-8
lines changed

.github/actions/install-rust/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ runs:
1313
- name: Install Rust
1414
shell: bash
1515
id: select
16+
env:
17+
# This is an attempt to reduce flakiness and see what happens. If this
18+
# lands it worked. Feel free to modify if this becomes flaky again.
19+
RUSTUP_USE_CURL: 1
1620
run: |
1721
# Determine MSRV as N in `1.N.0` by looking at the `rust-version`
1822
# located in the root `Cargo.toml`.
@@ -32,7 +36,12 @@ runs:
3236
shell: bash
3337
run: |
3438
rustup set profile minimal
35-
rustup update "${{ steps.select.outputs.version }}" --no-self-update
39+
for attempt in 1 2 3 4 5; do
40+
[ "$attempt" = "5" ] && exit 1
41+
rustup update "${{ steps.select.outputs.version }}" --no-self-update \
42+
&& break
43+
sleep 5
44+
done
3645
rustup default "${{ steps.select.outputs.version }}"
3746
3847
# Save disk space by avoiding incremental compilation. Also turn down

.github/workflows/main.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ jobs:
109109
- uses: ./.github/actions/install-rust
110110
- run: |
111111
set -e
112-
curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/0.14.5/cargo-deny-0.14.5-x86_64-unknown-linux-musl.tar.gz | tar xzf -
112+
curl --retry 5 --retry-all-errors -L -o cargo-deny.tar.gz https://github.com/EmbarkStudios/cargo-deny/releases/download/0.14.5/cargo-deny-0.14.5-x86_64-unknown-linux-musl.tar.gz
113+
tar xzf cargo-deny.tar.gz
114+
rm cargo-deny.tar.gz
113115
mv cargo-deny-*-x86_64-unknown-linux-musl/cargo-deny cargo-deny
114116
echo `pwd` >> $GITHUB_PATH
115117
- run: cargo deny check bans licenses
@@ -277,7 +279,10 @@ jobs:
277279
toolchain: wasmtime-ci-pinned-nightly
278280

279281
# Build C API documentation
280-
- run: curl -L https://sourceforge.net/projects/doxygen/files/rel-1.9.3/doxygen-1.9.3.linux.bin.tar.gz/download | tar xzf -
282+
- run: |
283+
curl --retry 5 --retry-all-errors -o doxygen.tar.gz -L https://github.com/doxygen/doxygen/releases/download/Release_1_9_3/doxygen-1.9.3.linux.bin.tar.gz
284+
tar xzf doxygen.tar.gz
285+
rm doxygen.tar.gz
281286
- run: echo "`pwd`/doxygen-1.9.3/bin" >> $GITHUB_PATH
282287
- run: cmake -S crates/c-api -B target/c-api
283288
- run: cmake --build target/c-api --target doc
@@ -645,7 +650,9 @@ jobs:
645650
# way faster at arm emulation than the current version github actions'
646651
# ubuntu image uses. Disable as much as we can to get it to build
647652
# quickly.
648-
curl https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz | tar xJf -
653+
curl --retry 5 --retry-all-errors -o qemu.tar.xz https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz
654+
tar xJf qemu.tar.xz
655+
rm qemu.tar.xz
649656
cd qemu-$QEMU_BUILD_VERSION
650657
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache}}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
651658
ninja -C build install
@@ -811,7 +818,9 @@ jobs:
811818

812819
- name: Install wasm-tools
813820
run: |
814-
curl -L https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.0.27/wasm-tools-1.0.27-x86_64-linux.tar.gz | tar xfz -
821+
curl --retry 5 --retry-all-errors -o wasm-tools.tar.gz -L https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.0.27/wasm-tools-1.0.27-x86_64-linux.tar.gz
822+
tar xfz wasm-tools.tar.gz
823+
rm wasm-tools.tar.gz
815824
echo `pwd`/wasm-tools-1.0.27-x86_64-linux >> $GITHUB_PATH
816825
817826
- run: ./ci/build-wasi-preview1-component-adapter.sh
@@ -955,7 +964,10 @@ jobs:
955964
- uses: ./.github/actions/install-rust
956965
- run: |
957966
cd ${{ runner.tool_cache }}
958-
curl -L https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz | tar xzf -
967+
curl --retry 5 --retry-all-errors -L -o sccache.tar.gz \
968+
https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
969+
tar xzf sccache.tar.gz
970+
rm sccache.tar.gz
959971
echo "`pwd`/sccache-0.2.13-x86_64-unknown-linux-musl" >> $GITHUB_PATH
960972
echo RUSTC_WRAPPER=sccache >> $GITHUB_ENV
961973
- run: rustc scripts/publish.rs

ci/docker/aarch64-linux/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ RUN apt-get update -y && apt-get install -y gcc gcc-aarch64-linux-gnu ca-certifi
44

55
# The CMake in Ubuntu 16.04 was a bit too old for us to use so download one from
66
# CMake's own releases and use that instead.
7-
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz | tar xzf -
7+
RUN curl --retry 5 -L -o cmake.tar.gz \
8+
https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz && \
9+
tar xf cmake.tar.gz && \
10+
rm cmake.tar.gz
811
ENV PATH=$PATH:/cmake-3.29.3-linux-x86_64/bin
912

1013
ENV PATH=$PATH:/rust/bin

ci/docker/s390x-linux/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ RUN apt-get update -y && apt-get install -y gcc gcc-s390x-linux-gnu ca-certifica
44

55
# The CMake in Ubuntu 16.04 was a bit too old for us to use so download one from
66
# CMake's own releases and use that instead.
7-
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz | tar xzf -
7+
RUN curl --retry 5 -L -o cmake.tar.gz \
8+
https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.tar.gz && \
9+
tar xf cmake.tar.gz && \
10+
rm cmake.tar.gz
811
ENV PATH=$PATH:/cmake-3.29.3-linux-x86_64/bin
912

1013
ENV PATH=$PATH:/rust/bin

0 commit comments

Comments
 (0)