Multiple tries for building dependencies on windows.

This commit is contained in:
Chris Penner 2022-03-31 12:31:19 -06:00
parent 1b575f26c4
commit 1c42911699

View File

@ -100,7 +100,21 @@ jobs:
# Build deps, then build local code. Splitting it into two steps just allows us to see how much time each step
# takes.
- name: build dependencies
run: stack --no-terminal build --fast --only-dependencies
# Run up to 5 times in a row before giving up.
# It's very unlikely that our build-dependencies step will fail on most builds,
# so if it fails its almost certainly due to a race condition on the Windows
# file-system API that stack runs into. Since any successful packages are
# cached within a single build, it should get further along on each re-start
# and should hopefully finish!
run: |
tries=1
if [[ ${{matrix.os}} = "windows-"* ]]; then
tries=5
fi
for (( i = 0; i < $tries; i++ )); do
stack --no-terminal build --fast --only-dependencies && break;
done
- name: build
run: stack --no-terminal build --fast --no-run-tests --test