Skip to content

Commit df7bade

Browse files
authored
[CI] Introduce shared Windows toolchain setup action (#470)
- add `.github/actions/setup-windows-toolchain` composite action - use this new action in all Windows jobs to configure MSVC and tooling
1 parent 8053348 commit df7bade

File tree

2 files changed

+28
-78
lines changed

2 files changed

+28
-78
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Setup Windows Toolchain'
2+
description: 'Configure msbuild, MPI, ccache, ninja, and MSVC'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Add msbuild to PATH
7+
uses: microsoft/setup-msbuild@v2
8+
with:
9+
vs-version: 'latest'
10+
- name: Setup MPI
11+
uses: mpi4py/setup-mpi@v1
12+
with:
13+
mpi: msmpi
14+
- name: Setup ccache
15+
uses: Chocobo1/setup-ccache-action@v1
16+
with:
17+
windows_compile_environment: msvc
18+
- name: Setup ninja
19+
uses: seanmiddleditch/gha-setup-ninja@v6
20+
- name: Setup MSVC for Ninja again
21+
uses: ilammy/msvc-dev-cmd@v1

.github/workflows/windows.yml

Lines changed: 7 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4
1212
with:
1313
submodules: recursive
14-
- name: Add msbuild to PATH
15-
uses: microsoft/setup-msbuild@v2
16-
with:
17-
vs-version: 'latest'
18-
- name: Setup MPI
19-
uses: mpi4py/setup-mpi@v1
20-
with:
21-
mpi: msmpi
22-
- name: Setup ccache
23-
uses: Chocobo1/setup-ccache-action@v1
24-
with:
25-
windows_compile_environment: msvc
26-
- name: Setup ninja
27-
uses: seanmiddleditch/gha-setup-ninja@v6
28-
- name: Setup MSVC for Ninja again
29-
uses: ilammy/msvc-dev-cmd@v1
14+
- uses: ./.github/actions/setup-windows-toolchain
3015
- name: CMake configure
3116
shell: bash
3217
run: >
@@ -54,22 +39,7 @@ jobs:
5439
- uses: actions/checkout@v4
5540
with:
5641
submodules: recursive
57-
- name: Add msbuild to PATH
58-
uses: microsoft/setup-msbuild@v2
59-
with:
60-
vs-version: 'latest'
61-
- name: Setup MPI
62-
uses: mpi4py/setup-mpi@v1
63-
with:
64-
mpi: msmpi
65-
- name: Setup ccache
66-
uses: Chocobo1/setup-ccache-action@v1
67-
with:
68-
windows_compile_environment: msvc
69-
- name: Setup ninja
70-
uses: seanmiddleditch/gha-setup-ninja@v6
71-
- name: Setup MSVC for Ninja again
72-
uses: ilammy/msvc-dev-cmd@v1
42+
- uses: ./.github/actions/setup-windows-toolchain
7343
- name: CMake configure
7444
shell: bash
7545
run: >
@@ -97,14 +67,7 @@ jobs:
9767
shell: bash
9868
steps:
9969
- uses: actions/checkout@v4
100-
- name: Add msbuild to PATH
101-
uses: microsoft/setup-msbuild@v2
102-
with:
103-
vs-version: 'latest'
104-
- name: Setup MPI
105-
uses: mpi4py/setup-mpi@v1
106-
with:
107-
mpi: msmpi
70+
- uses: ./.github/actions/setup-windows-toolchain
10871
- name: Download installed package
10972
uses: actions/download-artifact@v4
11073
with:
@@ -161,14 +124,7 @@ jobs:
161124
shell: bash
162125
steps:
163126
- uses: actions/checkout@v4
164-
- name: Add msbuild to PATH
165-
uses: microsoft/setup-msbuild@v2
166-
with:
167-
vs-version: 'latest'
168-
- name: Setup MPI
169-
uses: mpi4py/setup-mpi@v1
170-
with:
171-
mpi: msmpi
127+
- uses: ./.github/actions/setup-windows-toolchain
172128
- name: Download installed package
173129
uses: actions/download-artifact@v4
174130
with:
@@ -205,24 +161,11 @@ jobs:
205161
- uses: actions/checkout@v4
206162
with:
207163
submodules: recursive
208-
- name: Add msbuild to PATH
209-
uses: microsoft/setup-msbuild@v2
210-
with:
211-
vs-version: 'latest'
164+
- uses: ./.github/actions/setup-windows-toolchain
212165
- name: Setup LLVM
213166
uses: KyleMayes/install-llvm-action@v2
214167
with:
215168
version: "20.1.4"
216-
- name: Setup MPI
217-
uses: mpi4py/setup-mpi@v1
218-
with:
219-
mpi: msmpi
220-
- name: Setup ccache
221-
uses: Chocobo1/setup-ccache-action@v1
222-
with:
223-
windows_compile_environment: msvc
224-
- name: Setup ninja
225-
uses: seanmiddleditch/gha-setup-ninja@v6
226169
- name: CMake configure
227170
run: >
228171
cmake -S . -B build -G Ninja
@@ -256,14 +199,7 @@ jobs:
256199
shell: bash
257200
steps:
258201
- uses: actions/checkout@v4
259-
- name: Add msbuild to PATH
260-
uses: microsoft/setup-msbuild@v2
261-
with:
262-
vs-version: 'latest'
263-
- name: Setup MPI
264-
uses: mpi4py/setup-mpi@v1
265-
with:
266-
mpi: msmpi
202+
- uses: ./.github/actions/setup-windows-toolchain
267203
- name: Download installed package
268204
uses: actions/download-artifact@v4
269205
with:
@@ -300,14 +236,7 @@ jobs:
300236
shell: bash
301237
steps:
302238
- uses: actions/checkout@v4
303-
- name: Add msbuild to PATH
304-
uses: microsoft/setup-msbuild@v2
305-
with:
306-
vs-version: 'latest'
307-
- name: Setup MPI
308-
uses: mpi4py/setup-mpi@v1
309-
with:
310-
mpi: msmpi
239+
- uses: ./.github/actions/setup-windows-toolchain
311240
- name: Download installed package
312241
uses: actions/download-artifact@v4
313242
with:

0 commit comments

Comments
 (0)