Skip to content

Commit 3005c8d

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! ci(windows/gnu): install mingw via msys2/setup-msys2
1 parent 41d8974 commit 3005c8d

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,23 @@ jobs:
6868
if: matrix.mingwdir != ''
6969
run: |
7070
import os
71-
7271
paths = [
7372
r'C:\msys64\${{ matrix.mingwdir }}\bin',
7473
r'C:\msys64\usr\bin',
7574
]
76-
with open(os.environ["GITHUB_PATH"], "a") as f:
77-
for path in paths:
78-
f.write(path + "\n")
75+
excluded = {
76+
r'C:\mingw64\bin',
77+
}
78+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
79+
lines = fp.readlines()
80+
lines = paths + [l for l in lines if l not in excluded]
81+
fp.seek(0)
82+
fp.writelines(lines)
7983
- name: Verify mingw gcc installation
8084
shell: powershell
8185
if: matrix.mingwdir != ''
8286
run: |
87+
choco uninstall -y strawberryperl
8388
Get-Command ${{ matrix.gcc }}
8489
- name: Set PATH
8590
run: |
@@ -223,18 +228,23 @@ jobs:
223228
if: matrix.mingwdir != ''
224229
run: |
225230
import os
226-
227231
paths = [
228232
r'C:\msys64\${{ matrix.mingwdir }}\bin',
229233
r'C:\msys64\usr\bin',
230234
]
231-
with open(os.environ["GITHUB_PATH"], "a") as f:
232-
for path in paths:
233-
f.write(path + "\n")
235+
excluded = {
236+
r'C:\mingw64\bin',
237+
}
238+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
239+
lines = fp.readlines()
240+
lines = paths + [l for l in lines if l not in excluded]
241+
fp.seek(0)
242+
fp.writelines(lines)
234243
- name: Verify mingw gcc installation
235244
shell: powershell
236245
if: matrix.mingwdir != ''
237246
run: |
247+
choco uninstall -y strawberryperl
238248
Get-Command ${{ matrix.gcc }}
239249
- name: Set PATH
240250
run: |
@@ -384,18 +394,23 @@ jobs:
384394
if: matrix.mingwdir != ''
385395
run: |
386396
import os
387-
388397
paths = [
389398
r'C:\msys64\${{ matrix.mingwdir }}\bin',
390399
r'C:\msys64\usr\bin',
391400
]
392-
with open(os.environ["GITHUB_PATH"], "a") as f:
393-
for path in paths:
394-
f.write(path + "\n")
401+
excluded = {
402+
r'C:\mingw64\bin',
403+
}
404+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
405+
lines = fp.readlines()
406+
lines = paths + [l for l in lines if l not in excluded]
407+
fp.seek(0)
408+
fp.writelines(lines)
395409
- name: Verify mingw gcc installation
396410
shell: powershell
397411
if: matrix.mingwdir != ''
398412
run: |
413+
choco uninstall -y strawberryperl
399414
Get-Command ${{ matrix.gcc }}
400415
- name: Set PATH
401416
run: |

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,23 @@ jobs: # skip-master skip-pr skip-stable
6262
if: matrix.mingwdir != ''
6363
run: |
6464
import os
65-
6665
paths = [
6766
r'C:\msys64\${{ matrix.mingwdir }}\bin',
6867
r'C:\msys64\usr\bin',
6968
]
70-
with open(os.environ["GITHUB_PATH"], "a") as f:
71-
for path in paths:
72-
f.write(path + "\n")
69+
excluded = {
70+
r'C:\mingw64\bin',
71+
}
72+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
73+
lines = fp.readlines()
74+
lines = paths + [l for l in lines if l not in excluded]
75+
fp.seek(0)
76+
fp.writelines(lines)
7377
- name: Verify mingw gcc installation
7478
shell: powershell
7579
if: matrix.mingwdir != ''
7680
run: |
81+
choco uninstall -y strawberryperl
7782
Get-Command ${{ matrix.gcc }}
7883
- name: Set PATH
7984
run: |

0 commit comments

Comments
 (0)