Skip to content

Commit b9a4b29

Browse files
Retry haxelib installs in the downstream workflow and show why they fail
The Windows apps job of the downstream run on 04f436b failed installing its libraries after 50 seconds with nothing in the log: the loop sent haxelib's output, where its errors go too, to /dev/null. The same libraries installed on Ubuntu at the same time and on Windows the days before, so it was most likely lib.haxe.org failing a request. test/downstream/haxelib-install.sh runs haxelib install up to three times, 30 and 60 seconds apart, keeps its output out of the log while it works, and prints the end of it with a warning for each try that does not. Both jobs install through it.
1 parent 924157a commit b9a4b29

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎.github/workflows/downstream.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
- name: libraries
4444
shell: bash
4545
run: |
46-
haxelib install emitter 2.0.0 --always
47-
haxelib install utest 1.13.2 --always
46+
bash test/downstream/haxelib-install.sh emitter 2.0.0
47+
bash test/downstream/haxelib-install.sh utest 1.13.2
4848
haxelib set utest 1.13.2 --always
4949
haxelib dev crossbyte "$PWD/crossbyte"
5050
@@ -86,7 +86,7 @@ jobs:
8686
shell: bash
8787
run: |
8888
for lib in lime openfl lime-samples openfl-samples actuate flixel feathersui haxeui-core haxeui-openfl; do
89-
haxelib install $lib --always > /dev/null || exit 1
89+
bash test/downstream/haxelib-install.sh $lib || exit 1
9090
done
9191
haxelib list
9292

‎test/downstream/haxelib-install.sh‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# haxelib-install.sh LIBRARY [VERSION]
3+
#
4+
# haxelib install, tried three times. lib.haxe.org fails a request now and
5+
# then, and a nightly run should not fail on one bad download, nor fail with
6+
# nothing to show for it: the output is kept out of the log while the install
7+
# works, and shown for every try that does not.
8+
log=$(mktemp)
9+
for attempt in 1 2 3; do
10+
if haxelib install "$@" --always > "$log" 2>&1; then
11+
rm -f "$log"
12+
exit 0
13+
fi
14+
echo "::warning::haxelib install $* failed, try $attempt of 3:"
15+
tail -n 40 "$log"
16+
if [ $attempt -lt 3 ]; then
17+
sleep $((attempt * 30))
18+
fi
19+
done
20+
rm -f "$log"
21+
echo "::error::haxelib install $* failed three times"
22+
exit 1

0 commit comments

Comments
 (0)