[githubCI] Upgrade to vcpkg 2024.05.24
[ACE_TAO.git] / .github / workflows / windows.yml
blob5c95276a4ce3b4e8002dd4f02e5a71fe253c17a6
1 name: windows
3 on:
4   push:
5   pull_request:
6   schedule:
7     - cron: '0 1 * * SUN'
8   workflow_dispatch:
10 concurrency:
11   group: ${{ github.workflow }}-${{ github.ref }}
12   cancel-in-progress: true
14 jobs:
15   msvc:
16     strategy:
17       fail-fast: false
18       matrix:
19         include:
20           - name: VS2019WChar
21             vmimage: windows-2019
22             mpctype: vs2019
23             BuildPlatform: x64
24             BuildConfiguration: Debug
25             vcpkgarch: x64-windows
26             vcpkglibdir: debug/lib
27             vcpkgpackages: '"openssl", {"name": "xerces-c", "features": ["xmlch-wchar"]}, "zlib"'
28             OptionalFeatures: uses_wchar=1
29           - name: VS2019Debug64
30             vmimage: windows-2019
31             mpctype: vs2019
32             BuildPlatform: x64
33             BuildConfiguration: Debug
34             vcpkgarch: x64-windows
35             vcpkglibdir: debug/lib
36             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
37           - name: VS2019Release64
38             vmimage: windows-2019
39             mpctype: vs2019
40             BuildPlatform: x64
41             BuildConfiguration: Release
42             vcpkgarch: x64-windows
43             vcpkglibdir: lib
44             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
45           - name: VS2019Debug32
46             vmimage: windows-2019
47             mpctype: vs2019
48             BuildPlatform: Win32
49             BuildConfiguration: Debug
50             vcpkgarch: x86-windows
51             vcpkglibdir: debug/lib
52             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
53           - name: VS2019Release32
54             vmimage: windows-2019
55             mpctype: vs2019
56             BuildPlatform: Win32
57             BuildConfiguration: Release
58             vcpkgarch: x86-windows
59             vcpkglibdir: lib
60             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
61           - name: VS2019Debug64Cxx17
62             vmimage: windows-2019
63             mpctype: vs2019
64             BuildPlatform: x64
65             BuildConfiguration: Debug
66             vcpkgarch: x64-windows
67             vcpkglibdir: debug/lib
68             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
69             OptionalMpcArgs: -value_template LanguageStandard=stdcpp17
70           - name: VS2019Debug64Cxx20
71             vmimage: windows-2019
72             mpctype: vs2019
73             BuildPlatform: x64
74             BuildConfiguration: Debug
75             vcpkgarch: x64-windows
76             vcpkglibdir: debug/lib
77             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
78             OptionalMpcArgs: -value_template LanguageStandard=stdcpp20
79           - name: VS2022WChar
80             vmimage: windows-2022
81             mpctype: vs2022
82             BuildPlatform: x64
83             BuildConfiguration: Debug
84             vcpkgarch: x64-windows
85             vcpkglibdir: debug/lib
86             vcpkgpackages: '"openssl", {"name": "xerces-c", "features": ["xmlch-wchar"]}, "zlib"'
87             OptionalFeatures: uses_wchar=1
88           - name: VS2022Debug64
89             vmimage: windows-2022
90             mpctype: vs2022
91             BuildPlatform: x64
92             BuildConfiguration: Debug
93             vcpkgarch: x64-windows
94             vcpkglibdir: debug/lib
95             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
96           - name: VS2022Release64
97             vmimage: windows-2022
98             mpctype: vs2022
99             BuildPlatform: x64
100             BuildConfiguration: Release
101             vcpkgarch: x64-windows
102             vcpkglibdir: lib
103             vcpkgpackages: '"openssl", "xerces-c", "zlib"'
104     runs-on: ${{ matrix.vmimage }}
105     name: ${{ matrix.name }}
106     env:
107       ACE_ROOT: ${{ github.workspace }}/ACE
108       TAO_ROOT: ${{ github.workspace }}/TAO
109       MPC_ROOT: ${{ github.workspace }}/MPC
110       VCPKG_ROOT: ${{ github.workspace }}/vcpkg
111       XERCESC_INCDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/include
112       XERCESC_LIBDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
113       SSL_INCDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/include
114       SSL_LIBDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
115       ZLIB_INCDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/include
116       ZLIB_LIBDIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
117       VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkgarch }}
118       VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
119     steps:
120     - name: checkout ACE/TAO
121       uses: actions/checkout@v4
122     - name: checkout MPC
123       uses: actions/checkout@v4
124       with:
125         repository: DOCGroup/MPC
126         path: ${{ env.MPC_ROOT }}
127     - name: create vcpkg.json
128       run: |
129         '{"name": "tao","version-string": "githubaction","dependencies": [ ${{ matrix.vcpkgpackages }} ]}' > vcpkg.json
130       shell: pwsh
131     - name: Install vcpkg
132       uses: lukka/run-vcpkg@v11
133       with:
134         vcpkgGitCommitId: 01f602195983451bc83e72f4214af2cbc495aa94
135         runVcpkgInstall: true
136     - name: create $ACE_ROOT/ace/config.h
137       run: |
138         '#include "ace/config-win32.h"' > ${env:ACE_ROOT}/ace/config.h
139       shell: pwsh
140     - name: create $ACE_ROOT/bin/MakeProjectCreator/config/default.features
141       run: |
142         echo "ipv6=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
143         echo "xerces3=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
144         echo "ssl=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
145         echo "openssl11=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
146         echo "versioned_namespace=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
147         echo "zlib=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
148       shell: pwsh
149     - name: Add optional features ${{ matrix.OptionalFeatures }}
150       run: |
151         echo "${{ matrix.OptionalFeatures }}" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
152       shell: pwsh
153       if: matrix.OptionalFeatures != ''
154     - name: Run mwc.pl on $(TAO_ROOT)/TAO_ACE.mwc
155       run: |
156         perl ${env:ACE_ROOT}/bin/mwc.pl -type ${{ matrix.mpctype }} ${env:TAO_ROOT}/TAO_ACE.mwc -workers 4 ${{ matrix.OptionalMpcArgs }}
157       shell: pwsh
158     - name: Run mwc.pl on $(ACE_ROOT)/tests/tests.mwc
159       run: |
160         perl ${env:ACE_ROOT}/bin/mwc.pl -type ${{ matrix.mpctype }} ${env:ACE_ROOT}/tests/tests.mwc -workers 4 ${{ matrix.OptionalMpcArgs }}
161       shell: pwsh
162     - name: Run mwc.pl on $(TAO_ROOT)/tests/IDL_Test
163       run: |
164         perl ${env:ACE_ROOT}/bin/mwc.pl -type ${{ matrix.mpctype }} ${env:TAO_ROOT}/tests/IDL_Test -workers 4 ${{ matrix.OptionalMpcArgs }}
165       shell: pwsh
166     - name: Setup msbuild
167       uses: microsoft/setup-msbuild@v2
168     - name: Build solution TAO/TAO_ACE.sln
169       run: msbuild -maxcpucount -p:Platform=${{ matrix.BuildPlatform }} -p:Configuration=${{ matrix.BuildConfiguration }} TAO/TAO_ACE.sln
170     - name: Build solution ACE/tests/tests.sln
171       run: msbuild -maxcpucount -p:Platform=${{ matrix.BuildPlatform }} -p:Configuration=${{ matrix.BuildConfiguration }} ACE/tests/tests.sln
172     - name: Build solution TAO/tests/IDL_Test/IDL_Test.sln
173       run: msbuild -maxcpucount -p:Platform=${{ matrix.BuildPlatform }} -p:Configuration=${{ matrix.BuildConfiguration }} TAO/tests/IDL_Test/IDL_Test.sln
174   mingw:
175     runs-on: windows-2019
176     strategy:
177       fail-fast: false
178       matrix:
179         compiler: [gcc]
180         msystem: [MINGW64]
181         include:
182           - platform_file: include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
183     name: ${{ matrix.msystem }}-${{ matrix.compiler }}
184     env:
185       ACE_ROOT: ${{ github.workspace }}/ACE
186       TAO_ROOT: ${{ github.workspace }}/TAO
187       MPC_ROOT: ${{ github.workspace }}/MPC
188     steps:
189     - name: checkout ACE/TAO
190       uses: actions/checkout@v4
191     - name: checkout MPC
192       uses: actions/checkout@v4
193       with:
194         repository: DOCGroup/MPC
195         path: ${{ env.MPC_ROOT }}
196     - uses: msys2/setup-msys2@v2
197       with:
198         msystem: ${{ matrix.msystem }}
199         install: make
200     - run: pacman --noconfirm -S mingw-w64-x86_64-${{ matrix.compiler }}
201       shell: msys2 {0}
202     - run: ${{ matrix.compiler }} --version
203       shell: msys2 {0}
204     - name: create $ACE_ROOT/ace/config.h
205       run: |
206         '#include "ace/config-win32.h"' > ${env:ACE_ROOT}/ace/config.h
207       shell: pwsh
208     - name: create $ACE_ROOT/bin/MakeProjectCreator/config/default.features
209       run: |
210         echo "versioned_namespace=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
211       shell: pwsh
212     - name: Add optional features ${{ matrix.OptionalFeatures }}
213       run: |
214         echo "${{ matrix.OptionalFeatures }}" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
215       shell: pwsh
216       if: matrix.OptionalFeatures != ''
217     - name: add optional optional macros
218       run: |
219         '${{ matrix.optional_macros }}' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
220       shell: pwsh
221       if: matrix.optional_macros != ''
222     - name: extend $ACE_ROOT/include/makeinclude/platform_macros.GNU
223       run: |
224         '${{ matrix.platform_file }}' >>  ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
225       shell: pwsh
226     - name: Run mwc.pl on $(TAO_ROOT)/TAO_ACE.mwc
227       run: |
228         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:TAO_ROOT}/TAO_ACE.mwc -workers 4
229       shell: pwsh
230     - name: Run mwc.pl on $(ACE_ROOT)/tests/tests.mwc
231       run: |
232         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:ACE_ROOT}/tests/tests.mwc -workers 4
233       shell: pwsh
234     - name: Run mwc.pl on $(TAO_ROOT)/tests/IDL_Test
235       run: |
236         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:TAO_ROOT}/tests/IDL_Test -workers 4
237       shell: pwsh
238     - name: Build TAO_ACE project
239       run: |
240         export ACE_ROOT=`cygpath -u $ACE_ROOT`
241         export TAO_ROOT=`cygpath -u $TAO_ROOT`
242         make -j 6 -C $TAO_ROOT
243       shell: msys2 {0}
244     - name: Build ACE/tests project
245       run: |
246         export ACE_ROOT=`cygpath -u $ACE_ROOT`
247         export TAO_ROOT=`cygpath -u $TAO_ROOT`
248         make -j 6 -C $ACE_ROOT/tests
249       shell: msys2 {0}
250     - name: Build TAO/tests/IDL_Test project
251       run: |
252         export ACE_ROOT=`cygpath -u $ACE_ROOT`
253         export TAO_ROOT=`cygpath -u $TAO_ROOT`
254         make -j 6 -C $TAO_ROOT/tests/IDL_Test
255       shell: msys2 {0}