diff --git a/.github/actions/openms-core/action.yml b/.github/actions/openms-core/action.yml index 3bc44a08..72bcdf32 100644 --- a/.github/actions/openms-core/action.yml +++ b/.github/actions/openms-core/action.yml @@ -255,6 +255,40 @@ runs: mkdir -p "$GITHUB_WORKSPACE/.vcpkg-cache" echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/.vcpkg-cache,readwrite" >>"$GITHUB_ENV" + # The vcpkg executable comes from a GitHub release (bootstrap-vcpkg), whose download + # now and then fails with a status curl does not retry (e.g. HTTP 618), and that failed + # the whole job. Bootstrap here, up to 3 times. run-vcpkg then skips its own bootstrap: + # it rebuilds only when vcpkgLastBuiltCommitId (compared without trimming) differs from + # the HEAD of the vcpkg checkout or 'vcpkg version' fails. On ARM64 it would set + # VCPKG_FORCE_SYSTEM_BINARIES with its bootstrap, for the later steps; so does this one. + - name: Bootstrap vcpkg + if: steps.setup.outputs.mode == 'source' && steps.core-cache.outputs.cache-matched-key == '' + shell: bash + env: + VCPKG_DIR: ${{ github.workspace }}/_openms_core/vcpkg + run: | + set -euo pipefail + if [[ "$RUNNER_ARCH" == ARM64 ]]; then + export VCPKG_FORCE_SYSTEM_BINARIES=1 + echo "VCPKG_FORCE_SYSTEM_BINARIES=1" >>"$GITHUB_ENV" + fi + cd "$VCPKG_DIR" + attempts=3 + for attempt in $(seq 1 "$attempts"); do + if [[ "$RUNNER_OS" == Windows ]]; then + cmd.exe //c bootstrap-vcpkg.bat && break + else + sh ./bootstrap-vcpkg.sh && break + fi + if (( attempt == attempts )); then + echo >&2 "ERROR: bootstrapping vcpkg failed $attempts times" + exit 1 + fi + echo "::warning::bootstrapping vcpkg failed (attempt $attempt of $attempts), trying again in 15 s" + sleep 15 + done + printf '%s' "$(git rev-parse HEAD)" >vcpkgLastBuiltCommitId + - name: Set up vcpkg if: steps.setup.outputs.mode == 'source' && steps.core-cache.outputs.cache-matched-key == '' uses: lukka/run-vcpkg@v11