Skip to content

Commit 0011afb

Browse files
committed
ci(windows/gnu): install mingw from choco
1 parent 3582adc commit 0011afb

File tree

2 files changed

+16
-50
lines changed

2 files changed

+16
-50
lines changed

.github/workflows/ci.yaml

+12-37
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
- target: x86_64-pc-windows-msvc
3838
run_tests: YES
3939
- target: x86_64-pc-windows-gnu
40-
mingw: https://ci-mirrors.rust-lang.org/rustc/x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
4140
mingwdir: mingw64
4241
steps:
4342
- uses: actions/checkout@v4
@@ -57,17 +56,10 @@ jobs:
5756
New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force
5857
shell: powershell
5958
- name: Install mingw
60-
run: |
61-
# We retrieve mingw from the Rust CI buckets
62-
# Disable the download progress bar which can cause perf issues
63-
$ProgressPreference = "SilentlyContinue"
64-
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
65-
7z x -y mingw.7z -oC:\msys64 | Out-Null
66-
del mingw.7z
67-
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
68-
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6959
shell: powershell
70-
if: matrix.mingw != ''
60+
if: matrix.mingwdir != ''
61+
run: |
62+
choco install mingw -y --no-progress
7163
- name: Set PATH
7264
run: |
7365
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -123,7 +115,7 @@ jobs:
123115
cargo check --all --all-targets --features test
124116
git ls-files -- '*.rs' | xargs touch
125117
- name: Run cargo clippy
126-
if: matrix.mode != 'release' && matrix.mingw == ''
118+
if: matrix.mode != 'release' && matrix.mingwdir == ''
127119
env:
128120
TARGET: ${{ matrix.target }}
129121
run: |
@@ -179,7 +171,6 @@ jobs:
179171
- target: x86_64-pc-windows-msvc
180172
run_tests: YES
181173
- target: x86_64-pc-windows-gnu
182-
mingw: https://ci-mirrors.rust-lang.org/rustc/x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
183174
mingwdir: mingw64
184175
steps:
185176
- uses: actions/checkout@v4
@@ -199,17 +190,10 @@ jobs:
199190
New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force
200191
shell: powershell
201192
- name: Install mingw
202-
run: |
203-
# We retrieve mingw from the Rust CI buckets
204-
# Disable the download progress bar which can cause perf issues
205-
$ProgressPreference = "SilentlyContinue"
206-
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
207-
7z x -y mingw.7z -oC:\msys64 | Out-Null
208-
del mingw.7z
209-
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
210-
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
211193
shell: powershell
212-
if: matrix.mingw != ''
194+
if: matrix.mingwdir != ''
195+
run: |
196+
choco install mingw -y --no-progress
213197
- name: Set PATH
214198
run: |
215199
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -265,7 +249,7 @@ jobs:
265249
cargo check --all --all-targets --features test
266250
git ls-files -- '*.rs' | xargs touch
267251
- name: Run cargo clippy
268-
if: matrix.mode != 'release' && matrix.mingw == ''
252+
if: matrix.mode != 'release' && matrix.mingwdir == ''
269253
env:
270254
TARGET: ${{ matrix.target }}
271255
run: |
@@ -323,11 +307,9 @@ jobs:
323307
- target: x86_64-pc-windows-msvc
324308
run_tests: YES
325309
- target: x86_64-pc-windows-gnu
326-
mingw: https://ci-mirrors.rust-lang.org/rustc/x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
327310
mingwdir: mingw64
328311
- target: i686-pc-windows-gnu # skip-pr skip-master
329312
mingwdir: mingw32 # skip-pr skip-master
330-
mingw: https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z # skip-pr skip-master
331313
steps:
332314
- uses: actions/checkout@v4
333315
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -346,17 +328,10 @@ jobs:
346328
New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force
347329
shell: powershell
348330
- name: Install mingw
349-
run: |
350-
# We retrieve mingw from the Rust CI buckets
351-
# Disable the download progress bar which can cause perf issues
352-
$ProgressPreference = "SilentlyContinue"
353-
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
354-
7z x -y mingw.7z -oC:\msys64 | Out-Null
355-
del mingw.7z
356-
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
357-
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
358331
shell: powershell
359-
if: matrix.mingw != ''
332+
if: matrix.mingwdir != ''
333+
run: |
334+
choco install mingw -y --no-progress
360335
- name: Set PATH
361336
run: |
362337
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -412,7 +387,7 @@ jobs:
412387
cargo check --all --all-targets --features test
413388
git ls-files -- '*.rs' | xargs touch
414389
- name: Run cargo clippy
415-
if: matrix.mode != 'release' && matrix.mingw == ''
390+
if: matrix.mode != 'release' && matrix.mingwdir == ''
416391
env:
417392
TARGET: ${{ matrix.target }}
418393
run: |

ci/actions-templates/windows-builds-template.yaml

+4-13
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ jobs: # skip-master skip-pr skip-stable
2727
- target: x86_64-pc-windows-msvc
2828
run_tests: YES
2929
- target: x86_64-pc-windows-gnu
30-
mingw: https://ci-mirrors.rust-lang.org/rustc/x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
3130
mingwdir: mingw64
3231
- target: i686-pc-windows-gnu # skip-pr skip-master
3332
mingwdir: mingw32 # skip-pr skip-master
34-
mingw: https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z # skip-pr skip-master
3533
steps:
3634
- uses: actions/checkout@v4
3735
# v2 defaults to a shallow checkout, but we need at least to the previous tag
@@ -50,17 +48,10 @@ jobs: # skip-master skip-pr skip-stable
5048
New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force
5149
shell: powershell
5250
- name: Install mingw
53-
run: |
54-
# We retrieve mingw from the Rust CI buckets
55-
# Disable the download progress bar which can cause perf issues
56-
$ProgressPreference = "SilentlyContinue"
57-
Invoke-WebRequest ${{ matrix.mingw }} -OutFile mingw.7z
58-
7z x -y mingw.7z -oC:\msys64 | Out-Null
59-
del mingw.7z
60-
echo "C:\msys64\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
61-
echo "C:\msys64\${{ matrix.mingwdir }}\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
6251
shell: powershell
63-
if: matrix.mingw != ''
52+
if: matrix.mingwdir != ''
53+
run: |
54+
choco install mingw -y --no-progress
6455
- name: Set PATH
6556
run: |
6657
echo "%USERPROFILE%\.cargo\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -116,7 +107,7 @@ jobs: # skip-master skip-pr skip-stable
116107
cargo check --all --all-targets --features test
117108
git ls-files -- '*.rs' | xargs touch
118109
- name: Run cargo clippy
119-
if: matrix.mode != 'release' && matrix.mingw == ''
110+
if: matrix.mode != 'release' && matrix.mingwdir == ''
120111
env:
121112
TARGET: ${{ matrix.target }}
122113
run: |

0 commit comments

Comments
 (0)