Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6dcf9ef

Browse files
committedJun 3, 2024··
fixup! fixup! fixup! fixup! fixup! fixup! ci(windows/gnu): install mingw via msys2/setup-msys2
1 parent 41d8974 commit 6dcf9ef

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed
 

‎.github/workflows/ci.yaml

+15-12
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ 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+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
76+
lines = fp.readlines()
77+
lines = paths + lines
78+
fp.seek(0)
79+
fp.writelines(lines)
7980
- name: Verify mingw gcc installation
8081
shell: powershell
8182
if: matrix.mingwdir != ''
@@ -223,14 +224,15 @@ jobs:
223224
if: matrix.mingwdir != ''
224225
run: |
225226
import os
226-
227227
paths = [
228228
r'C:\msys64\${{ matrix.mingwdir }}\bin',
229229
r'C:\msys64\usr\bin',
230230
]
231-
with open(os.environ["GITHUB_PATH"], "a") as f:
232-
for path in paths:
233-
f.write(path + "\n")
231+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
232+
lines = fp.readlines()
233+
lines = paths + lines
234+
fp.seek(0)
235+
fp.writelines(lines)
234236
- name: Verify mingw gcc installation
235237
shell: powershell
236238
if: matrix.mingwdir != ''
@@ -384,14 +386,15 @@ jobs:
384386
if: matrix.mingwdir != ''
385387
run: |
386388
import os
387-
388389
paths = [
389390
r'C:\msys64\${{ matrix.mingwdir }}\bin',
390391
r'C:\msys64\usr\bin',
391392
]
392-
with open(os.environ["GITHUB_PATH"], "a") as f:
393-
for path in paths:
394-
f.write(path + "\n")
393+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
394+
lines = fp.readlines()
395+
lines = paths + lines
396+
fp.seek(0)
397+
fp.writelines(lines)
395398
- name: Verify mingw gcc installation
396399
shell: powershell
397400
if: matrix.mingwdir != ''

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ 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+
with open(os.environ["GITHUB_PATH"], "r+") as fp:
70+
lines = fp.readlines()
71+
lines = paths + lines
72+
fp.seek(0)
73+
fp.writelines(lines)
7374
- name: Verify mingw gcc installation
7475
shell: powershell
7576
if: matrix.mingwdir != ''

0 commit comments

Comments
 (0)
Please sign in to comment.