@@ -10,7 +10,7 @@ concurrency:
10
10
cancel-in-progress : true
11
11
12
12
jobs :
13
- posix :
13
+ main :
14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
@@ -61,12 +61,20 @@ jobs:
61
61
# de-facto bootstrap version on OSX
62
62
# See: https://github.com/dlang/dmd/pull/13890
63
63
host_dmd : dmd-2.099.1
64
+ # Windows
65
+ - job_name : Windows x64, LDC
66
+ os : windows-2022
67
+ host_dmd : ldc-latest
68
+ - job_name : Windows x86, LDC
69
+ os : windows-2022
70
+ host_dmd : ldc-latest
71
+ model : 32
64
72
name : ${{ matrix.job_name }}
65
73
runs-on : ${{ matrix.os }}
66
74
timeout-minutes : 40
67
75
env :
68
76
# for ci/run.sh:
69
- OS_NAME : ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'osx' || '' ) }}
77
+ OS_NAME : ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'osx' || (startsWith(matrix.os, 'windows') && 'windows' || '') ) }}
70
78
MODEL : ${{ matrix.model || '64' }}
71
79
HOST_DMD : ${{ matrix.host_dmd }}
72
80
N : ${{ startsWith(matrix.os, 'macos') && '3' || '2' }}
@@ -75,14 +83,32 @@ jobs:
75
83
DMD_TEST_COVERAGE : ${{ matrix.coverage && '1' || '0' }}
76
84
# work around https://issues.dlang.org/show_bug.cgi?id=23517
77
85
MACOSX_DEPLOYMENT_TARGET : ' 11'
86
+ defaults :
87
+ run :
88
+ shell : bash
78
89
steps :
79
90
- uses : actions/checkout@v4
80
91
with :
81
92
fetch-depth : 50
82
- - name : Install prerequisites
93
+
94
+ - name : ' Posix: Install prerequisites'
95
+ if : runner.os != 'Windows'
83
96
run : ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }}
84
- - name : Install host compiler
97
+ - name : ' Windows: Set up MSVC environment'
98
+ if : runner.os == 'Windows'
99
+ uses : seanmiddleditch/gha-setup-vsdevenv@v4
100
+ with :
101
+ arch : ${{ env.MODEL == '64' && 'x64' || 'x86' }}
102
+
103
+ - name : ' Posix: Install host compiler'
104
+ if : runner.os != 'Windows'
85
105
run : ci/run.sh install_host_compiler
106
+ - name : ' Windows: Install host compiler'
107
+ if : runner.os == 'Windows'
108
+ uses :
dlang-community/[email protected]
109
+ with :
110
+ compiler : ${{ matrix.host_dmd }}
111
+
86
112
- name : Set up repos
87
113
run : |
88
114
set -uexo pipefail
@@ -104,6 +130,12 @@ jobs:
104
130
ci/run.sh setup_repos "$REPO_BRANCH"
105
131
- name : Build
106
132
run : ${{ matrix.disable_debug_for_dmd_unittests && 'ENABLE_DEBUG=0' || '' }} ci/run.sh build
133
+ env :
134
+ # on Windows, `ci/run.sh build` expects the DMD env var to be set to the DMD-CLI-compatible host compiler
135
+ DMD : ${{ runner.os == 'Windows' && (startsWith(matrix.host_dmd, 'ldc') && 'ldmd2' || 'dmd') || '' }}
136
+ # work around the LDC host compiler on Windows assuming the first link.exe in PATH is the MSVC one
137
+ # (VSINSTALLDIR is set, but GHA uses Git's bin\bash.exe for `shell: bash`, which prepends Git's usr\bin to PATH, with GNU link.exe)
138
+ LDC_VSDIR_FORCE : ${{ runner.os == 'Windows' && startsWith(matrix.host_dmd, 'ldc') && '1' || '' }}
107
139
- name : Rebuild dmd (with enabled coverage)
108
140
if : matrix.coverage
109
141
run : ENABLE_RELEASE=0 ENABLE_DEBUG=1 ENABLE_COVERAGE=1 ci/run.sh rebuild
@@ -112,6 +144,13 @@ jobs:
112
144
- name : Test druntime
113
145
if : ' !matrix.coverage'
114
146
run : ci/run.sh test_druntime
147
+ - name : ' Windows x86: Add 32-bit libcurl.dll to PATH (required for Phobos unittests)'
148
+ if : runner.os == 'Windows' && env.MODEL == '32' && !matrix.coverage
149
+ run : |
150
+ # LDC
151
+ echo "$(dirname "$(which $DC)")/../lib32" >> $GITHUB_PATH
152
+ # DMD
153
+ echo "$(dirname "$(which $DC)")/../bin" >> $GITHUB_PATH
115
154
- name : Test phobos
116
155
if : ' !matrix.coverage'
117
156
run : ci/run.sh test_phobos
0 commit comments