Skip to content

Commit 38d73d3

Browse files
authored
ci: retry all setup commands that need network access, till they succeed (so the CI jobs have less false positives) (#21103)
1 parent 24bb06d commit 38d73d3

20 files changed

+131
-127
lines changed

.github/workflows/build_vinix_locally.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ mkdir -p $BUILD
2121

2222
cd $BUILD
2323
echo "Clone current Vinix"
24-
git clone https://github.com/vlang/vinix.git --depth=1
24+
.github/workflows/retry.sh git clone https://github.com/vlang/vinix.git --depth=1
2525

2626
cd $BUILD
2727
echo "Clone current mlibc"
28-
git clone https://github.com/managarm/mlibc.git --depth=1
28+
.github/workflows/retry.sh git clone https://github.com/managarm/mlibc.git --depth=1
2929

3030
cd $BUILD
3131
echo "Patch mlibc for Vinix"

.github/workflows/c2v_ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ jobs:
3737
run: make && ./v symlink -githubci
3838
- name: Install C2V
3939
run: |
40-
v install --git https://github.com/vlang/c2v
40+
.github/workflows/retry.sh v install --git https://github.com/vlang/c2v
4141
v -g ~/.vmodules/c2v/ || true
4242
- name: Install dependencies
4343
run: |
4444
if [ "${{ runner.os }}" == "Linux" ]; then
45-
sudo apt update -y -qq
46-
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
45+
.github/workflows/retry.sh sudo apt update -y -qq
46+
.github/workflows/retry.sh sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
4747
else
48-
brew install sdl2 sdl2_mixer sdl2_net libpng libsamplerate
48+
.github/workflows/retry.sh brew install sdl2 sdl2_mixer sdl2_net libpng libsamplerate
4949
fi
5050
- name: Build original Chocolate Doom
5151
run: |
52-
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
52+
.github/workflows/retry.sh git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
5353
cd ~/code/doom/chocolate-doom
5454
cmake -DCMAKE_BUILD_TYPE=Debug .
5555
make chocolate-doom
@@ -73,32 +73,32 @@ jobs:
7373
run: make && ./v symlink -githubci
7474
- name: Install C2V
7575
run: |
76-
v install --git https://github.com/vlang/c2v
76+
.github/workflows/retry.sh v install --git https://github.com/vlang/c2v
7777
v -g ~/.vmodules/c2v/ || true
7878
- name: Install dependencies
7979
run: |
80-
sudo apt update -y -qq
81-
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
80+
.github/workflows/retry.sh sudo apt update -y -qq
81+
.github/workflows/retry.sh sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
8282
# c2v / DOOM dependencies
8383
# vgret dependencies
8484
# imagemagick : convert, mogrify, import
8585
# xvfb : For starting X11 Virtual FrameBuffers
8686
# openimageio-tools : idiff
8787
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
8888
# freeglut3-dev : Fixes graphic apps compilation with tcc
89-
sudo apt install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
89+
.github/workflows/retry.sh sudo apt install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
9090
- name: Setup test tools
9191
run: |
9292
# Fetch the free ~4MB DOOM1.WAD from the link at https://doomwiki.org/wiki/DOOM1.WAD
93-
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
93+
.github/workflows/retry.sh wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
9494
# Get imgur upload script
95-
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
95+
.github/workflows/retry.sh wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
9696
chmod +x ./imgur.sh
9797
# Get regression images to test against
98-
git clone https://github.com/Larpon/doom-regression-images
98+
.github/workflows/retry.sh git clone https://github.com/Larpon/doom-regression-images
9999
- name: Build original Chocolate Doom
100100
run: |
101-
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
101+
.github/workflows/retry.sh git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
102102
cd ~/code/doom/chocolate-doom
103103
cmake -DCMAKE_BUILD_TYPE=Debug .
104104
make chocolate-doom

.github/workflows/compile_v_with_vtcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ show "Prepare"
1010
rm -rf vtcc/
1111

1212
show "Clone vtcc"
13-
git clone https://github.com/felipensp/vtcc --branch stable --quiet vtcc/
13+
.github/workflows/retry.sh git clone https://github.com/felipensp/vtcc --branch stable --quiet vtcc/
1414
du -s vtcc/
1515
## TODO: just `./v vtcc`, later will cause V, to detect the compiler as tcc (which it is), and add `-fwrapv`, which causes the vtcc compiler to panic currently
1616
show "Compile vtcc"

.github/workflows/cross_ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Install dependencies
2525
run: |
26-
brew install mingw-w64
26+
.github/workflows/retry.sh brew install mingw-w64
2727
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
2828
2929
- name: Build V
@@ -55,10 +55,10 @@ jobs:
5555
- name: Install dependencies
5656
run: |
5757
## sudo dpkg --add-architecture i386
58-
sudo apt update
59-
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
60-
sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks
61-
## sudo apt-get install --quiet -y wine32
58+
.github/workflows/retry.sh sudo apt update
59+
.github/workflows/retry.sh sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev
60+
.github/workflows/retry.sh sudo apt-get install --quiet -y mingw-w64 wine-stable winetricks
61+
## .github/workflows/retry.sh sudo apt-get install --quiet -y wine32
6262
6363
- name: Turn off the wine crash dialog
6464
run: winetricks nocrashdialog

.github/workflows/freebsd_build_tcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rm -rf thirdparty/tcc/
77

88
pushd .
99

10-
git clone git://repo.or.cz/tinycc.git
10+
.github/workflows/retry.sh git clone git://repo.or.cz/tinycc.git
1111
cd tinycc
1212

1313
export CC=clang

.github/workflows/gen_vc_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD)
2727
2828
rm -rf vc
29-
git clone --depth=1 \
29+
.github/workflows/retry.sh git clone --depth=1 \
3030
https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@$VREPO
3131
3232
rm -rf vc/v.c vc/v_win.c
@@ -45,7 +45,7 @@ jobs:
4545
git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"
4646
4747
# in case there are recent commits:
48-
git -C vc pull --rebase origin master
48+
.github/workflows/retry.sh git -C vc pull --rebase origin master
4949
# Note that failure below may happen, due to vlang/vc rejecting the push
5050
# from forked repos; that is not usually a problem.
5151
git -C vc push || true

.github/workflows/gg_regressions_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
# libxcursor-dev libxi-dev : V gfx deps
3434
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
3535
# freeglut3-dev : Fixes graphic apps compilation with tcc
36-
sudo apt-get update
37-
sudo apt-get install imagemagick openimageio-tools libgl1-mesa-dri xvfb libxcursor-dev libxi-dev freeglut3-dev xsel xclip
38-
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
39-
git clone https://github.com/Larpon/gg-regression-images gg-regression-images
36+
.github/workflows/retry.sh sudo apt-get update
37+
.github/workflows/retry.sh sudo apt-get install imagemagick openimageio-tools libgl1-mesa-dri xvfb libxcursor-dev libxi-dev freeglut3-dev xsel xclip
38+
.github/workflows/retry.sh wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
39+
.github/workflows/retry.sh git clone https://github.com/Larpon/gg-regression-images gg-regression-images
4040
chmod +x ./imgur.sh
4141
4242
- name: Sample and compare

.github/workflows/linux_ci.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- name: Install dependencies
1616
run: |
17-
sudo apt-get update
18-
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
19-
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
17+
.github/workflows/retry.sh sudo apt-get update
18+
.github/workflows/retry.sh sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
19+
.github/workflows/retry.sh sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
2020
# The following is needed for examples/wkhtmltopdf.v
21-
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
22-
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
23-
sudo apt-get install --quiet -y expect
24-
sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb
21+
.github/workflows/retry.sh wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
22+
.github/workflows/retry.sh sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
23+
.github/workflows/retry.sh sudo apt-get install --quiet -y expect
24+
.github/workflows/retry.sh sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb
2525
- name: Build v
2626
run: |
2727
echo $VFLAGS
@@ -94,14 +94,14 @@ jobs:
9494
- uses: actions/checkout@v4
9595
- name: Install dependencies
9696
run: |
97-
sudo apt-get update
98-
sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
99-
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
100-
sudo apt-get install --quiet -y libgc-dev
97+
.github/workflows/retry.sh sudo apt-get update
98+
.github/workflows/retry.sh sudo apt-get install --quiet -y libssl-dev sqlite3 libsqlite3-dev valgrind
99+
.github/workflows/retry.sh sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
100+
.github/workflows/retry.sh sudo apt-get install --quiet -y libgc-dev
101101
# The following is needed for examples/wkhtmltopdf.v
102-
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
103-
sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
104-
sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb
102+
.github/workflows/retry.sh wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
103+
.github/workflows/retry.sh sudo apt-get install --quiet -y xfonts-75dpi xfonts-base
104+
.github/workflows/retry.sh sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb
105105
- name: Build v
106106
run: |
107107
echo $VFLAGS
@@ -149,9 +149,9 @@ jobs:
149149
- uses: actions/checkout@v4
150150
- name: Install dependencies
151151
run: |
152-
sudo apt-get update
153-
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
154-
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
152+
.github/workflows/retry.sh sudo apt-get update
153+
.github/workflows/retry.sh sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
154+
.github/workflows/retry.sh sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
155155
- name: Build V
156156
run: make -j4 && ./v -cc gcc -cg -cstrict -o v cmd/v
157157
- name: Valgrind v.c
@@ -169,9 +169,9 @@ jobs:
169169
# - name: Test v->js
170170
# run: ./v -o hi.js examples/hello_v_js.v && node hi.js
171171
# - name: Build Vorum
172-
# run: git clone --depth 1 https://github.com/vlang/vorum && cd vorum && ../v . && cd ..
172+
# run: .github/workflows/retry.sh git clone --depth 1 https://github.com/vlang/vorum && cd vorum && ../v . && cd ..
173173
- name: Build vpm
174-
run: ./v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
174+
run: .github/workflows/retry.sh ./v install markdown && .github/workflows/retry.sh git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
175175
- name: Freestanding
176176
run: ./v -freestanding run vlib/os/bare/bare_example_linux.v
177177
- name: V self compilation
@@ -259,10 +259,10 @@ jobs:
259259
- uses: actions/checkout@v4
260260
- name: Install dependencies
261261
run: |
262-
sudo apt-get update
263-
sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
264-
sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
265-
sudo apt-get install --quiet -y clang
262+
.github/workflows/retry.sh sudo apt-get update
263+
.github/workflows/retry.sh sudo apt-get install --quiet -y postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
264+
.github/workflows/retry.sh sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev
265+
.github/workflows/retry.sh sudo apt-get install --quiet -y clang
266266
- name: Build V
267267
run: make -j4 && ./v -cc clang -cg -cstrict -o v cmd/v
268268
- name: Valgrind
@@ -363,7 +363,7 @@ jobs:
363363
# - uses: actions/checkout@v4
364364
# - name: Install dependencies
365365
# run: |
366-
# sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind
366+
# .github/workflows/retry.sh sudo apt-get install --quiet -y musl musl-tools libssl-dev sqlite3 libsqlite3-dev valgrind
367367
# - name: Build v
368368
# run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
369369
# # - name: Test v binaries

.github/workflows/macos_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
echo "PKG_CONFIG_PATH is '$PKG_CONFIG_PATH'"
19-
brew install libpq openssl mercurial
19+
.github/workflows/retry.sh brew install libpq openssl mercurial
2020
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
2121
echo "LIBRARY_PATH is '$LIBRARY_PATH'"
2222
- name: Build V
@@ -30,7 +30,7 @@ jobs:
3030
- name: Test symlink
3131
run: ./v symlink
3232
- name: Build vpm
33-
run: ./v install markdown && git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
33+
run: .github/workflows/retry.sh ./v install markdown && .github/workflows/retry.sh git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
3434
# - name: Set up pg database
3535
# run: |
3636
# pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@@ -68,14 +68,14 @@ jobs:
6868
./v doctor
6969
- name: Test ved
7070
run: |
71-
git clone --depth 1 https://github.com/vlang/ved
71+
.github/workflows/retry.sh git clone --depth 1 https://github.com/vlang/ved
7272
cd ved && ../v -o ved .
7373
../v -autofree .
7474
../v -prod .
7575
cd ..
7676
- name: Build V UI examples
7777
run: |
78-
git clone --depth 1 https://github.com/vlang/ui
78+
.github/workflows/retry.sh git clone --depth 1 https://github.com/vlang/ui
7979
cd ui
8080
mkdir -p ~/.vmodules
8181
ln -s $(pwd) ~/.vmodules/ui

.github/workflows/native_backend_tests_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install linker
6464
if: ${{ startsWith(matrix.os, 'ubuntu')}}
6565
run: |
66-
sudo apt-get install --quiet -y binutils
66+
.github/workflows/retry.sh sudo apt-get install --quiet -y binutils
6767
6868
- name: Build V with make.bat
6969
if: ${{ startsWith(matrix.os, 'windows') }}

0 commit comments

Comments
 (0)