Limit access for github actions
[MPC.git] / .github / workflows / windows.yml
blob3b53f91b7f22fd2ebb1a1b8953635673b9241fc5
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 permissions:
15   contents: read
17 jobs:
18   build:
19     strategy:
20       fail-fast: false
21       matrix:
22         include:
23           - name: VS2019Debug64
24             vmimage: windows-2019
25             mpctype: vs2019
26             BuildPlatform: x64
27             BuildConfiguration: Debug
28             vcpkgarch: x64-windows
29             vcpkglibdir: debug/lib
30             vcpkgpackages: openssl xerces-c zlib
31           - name: VS2019Release32
32             vmimage: windows-2019
33             mpctype: vs2019
34             BuildPlatform: Win32
35             BuildConfiguration: Release
36             vcpkgarch: x86-windows
37             vcpkglibdir: lib
38             vcpkgpackages: openssl xerces-c zlib
39           - name: VS2022Debug64
40             vmimage: windows-2022
41             mpctype: vs2022
42             BuildPlatform: x64
43             BuildConfiguration: Debug
44             vcpkgarch: x64-windows
45             vcpkglibdir: debug/lib
46             vcpkgpackages: openssl xerces-c zlib
47           - name: VS2022Release32
48             vmimage: windows-2022
49             mpctype: vs2022
50             BuildPlatform: Win32
51             BuildConfiguration: Release
52             vcpkgarch: x86-windows
53             vcpkglibdir: lib
54             vcpkgpackages: openssl xerces-c zlib
55     runs-on: ${{ matrix.vmimage }}
56     name: ${{ matrix.name }}
57     env:
58       DOC_ROOT: ${{ github.workspace }}/ACE_TAO
59       ACE_ROOT: ${{ github.workspace }}/ACE_TAO/ACE
60       TAO_ROOT: ${{ github.workspace }}/ACE_TAO/TAO
61       MPC_ROOT: ${{ github.workspace }}/
62       VCPKG_ROOT: ${{ github.workspace }}/vcpkg
63       XERCESC_INCDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/include
64       XERCESC_LIBDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
65       SSL_INCDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/include
66       SSL_LIBDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
67       ZLIB_INCDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/include
68       ZLIB_LIBDIR: ${{ github.workspace }}/vcpkg/installed/${{ matrix.vcpkgarch }}/${{ matrix.vcpkglibdir }}
69     steps:
70     - name: checkout MPC
71       uses: actions/checkout@v3
72     - name: checkout ACE_TAO
73       uses: actions/checkout@v3
74       with:
75         repository: DOCGroup/ACE_TAO
76         path: ${{ env.DOC_ROOT }}
77     - name: Install vcpkg
78       uses: lukka/run-vcpkg@v7
79       with:
80         vcpkgGitCommitId: b86c0c35b88e2bf3557ff49dc831689c2f085090
81         vcpkgArguments: --recurse ${{ matrix.vcpkgpackages }}
82         vcpkgTriplet: ${{ matrix.vcpkgarch }}
83         appendedCacheKey: ${{ matrix.name }}
84     - name: create $ACE_ROOT/ace/config.h
85       run: |
86         '#include "ace/config-win32.h"' > ${env:ACE_ROOT}/ace/config.h
87       shell: pwsh
88     - name: create $ACE_ROOT/bin/MakeProjectCreator/config/default.features
89       run: |
90         echo "ipv6=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
91         echo "xerces3=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
92         echo "ssl=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
93         echo "openssl11=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
94         echo "versioned_namespace=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
95         echo "zlib=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
96       shell: pwsh
97     - name: Add optional features ${{ matrix.OptionalFeatures }}
98       run: |
99         echo "${{ matrix.OptionalFeatures }}" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
100       shell: pwsh
101       if: matrix.OptionalFeatures != ''
102     - name: Run mwc.pl on $(TAO_ROOT)/TAO_ACE.mwc
103       run: |
104         perl ${env:ACE_ROOT}/bin/mwc.pl -type ${{ matrix.mpctype }} ${env:TAO_ROOT}/TAO_ACE.mwc -workers 4
105       shell: pwsh
106     - name: Setup msbuild
107       uses: microsoft/setup-msbuild@v1
108     - name: Build solution $(TAO_ROOT)/TAO_ACE.sln
109       run: |
110         msbuild -maxcpucount -p:Platform=${{ matrix.BuildPlatform }} -p:Configuration=${{ matrix.BuildConfiguration }} ${env:TAO_ROOT}/TAO_ACE.sln
111       shell: pwsh