diff options
author | Angus Gratton <angus@redyak.com.au> | 2025-09-09 12:34:30 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-09-24 23:47:39 +1000 |
commit | 91abffb4d66abd22ba4cb29beb3cde4ba7a7eda6 (patch) | |
tree | 1f5779d5bce8a1ef138be34c9ac8549c5f73bbfc | |
parent | 0d9aafd9f508c89dc13bbf06583f24cbee3fedfa (diff) |
github/workflows: Retry Windows VC2017 & 2019 install steps.
The Windows 8.1 sdksetup.exe in particular seems seems to fail
intermittently pretty often, so retry each step up to four times before
failing outright.
Delete the Chocolatey temp directory between each run, as it seems like the
root cause is a corrupt download.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
-rw-r--r-- | .github/workflows/ports_windows.yml | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/.github/workflows/ports_windows.yml b/.github/workflows/ports_windows.yml index 84a93a504..16396f0fd 100644 --- a/.github/workflows/ports_windows.yml +++ b/.github/workflows/ports_windows.yml @@ -29,8 +29,10 @@ jobs: include: - visualstudio: '2017' vs_version: '[15, 16)' + custom_vs_install: true - visualstudio: '2019' vs_version: '[16, 17)' + custom_vs_install: true - visualstudio: '2022' vs_version: '[17, 18)' # trim down the number of jobs in the matrix @@ -43,18 +45,17 @@ jobs: env: CI_BUILD_CONFIGURATION: ${{ matrix.configuration }} steps: - - name: Install Visual Studio 2017 - if: matrix.visualstudio == '2017' + - name: Install Visual Studio ${{ matrix.visualstudio }} + if: matrix.custom_vs_install + shell: bash + # Shell functions in this block are to retry intermittent corrupt + # downloads (with a clean download dir) before failing the job outright run: | - choco install visualstudio2017buildtools - choco install visualstudio2017-workload-vctools - choco install windows-sdk-8.1 - - name: Install Visual Studio 2019 - if: matrix.visualstudio == '2019' - run: | - choco install visualstudio2019buildtools - choco install visualstudio2019-workload-vctools - choco install windows-sdk-8.1 + try () { ($@) || ($@) || ($@) || ($@) } + clean_install () ( rm -rf $TEMP/chocolatey; choco install $1 ) + try clean_install visualstudio${{ matrix.visualstudio }}buildtools + try clean_install visualstudio${{ matrix.visualstudio }}-workload-vctools + try clean_install windows-sdk-8.1 - uses: microsoft/setup-msbuild@v2 with: vs-version: ${{ matrix.vs_version }} |