Merge pull request #2240 from DOCGroup/revert-2239-jwi-pi23
[ACE_TAO.git] / .github / workflows / linux.yml
blobbffe2c7864d0638fa4af7e36497f83499105e210
1 name: linux
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     permissions:
20       actions: read  # for github/codeql-action/init to get workflow details
21       contents: read  # for actions/checkout to fetch code
22       security-events: write  # for github/codeql-action/analyze to upload SARIF results
23     strategy:
24       fail-fast: false
25       matrix:
26         include:
27           - CC: gcc-7
28             CXX: g++-7
29             PackageDeps: g++-7
30             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
31             os: ubuntu-20.04
32             CheckPkgConfig: 1
33           - CC: gcc-8
34             CXX: g++-8
35             PackageDeps: g++-8
36             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
37             os: ubuntu-20.04
38           - CC: gcc-9
39             CXX: g++-9
40             PackageDeps: g++-9
41             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
42             os: ubuntu-20.04
43           - CC: gcc-10
44             CXX: g++-10
45             PackageDeps: g++-10
46             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
47             os: ubuntu-20.04
48           - CC: gcc-11
49             CXX: g++-11
50             PackageDeps: g++-11
51             optional_macros: c++std=c++20
52             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
53             os: ubuntu-22.04
54           - CC: gcc-12
55             CXX: g++-12
56             PackageDeps: g++-12
57             optional_macros: c++std=c++20
58             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
59             os: ubuntu-22.04
60           - CC: gcc-13
61             CXX: g++-13
62             PackageDeps: g++-13
63             optional_macros: c++std=c++20
64             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
65             os: ubuntu-24.04
66           - CC: clang-6.0
67             CXX: clang++-6.0
68             PackageDeps: clang-6.0
69             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
70             os: ubuntu-20.04
71           - CC: clang-7
72             CXX: clang++-7
73             PackageDeps: clang-7
74             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
75             os: ubuntu-20.04
76           - CC: clang-8
77             CXX: clang++-8
78             PackageDeps: clang-8
79             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
80             os: ubuntu-20.04
81           - CC: clang-9
82             CXX: clang++-9
83             PackageDeps: clang-9
84             Repo: llvm-toolchain-$(lsb_release -cs)-9
85             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
86             os: ubuntu-20.04
87           - CC: clang-10
88             CXX: clang++-10
89             PackageDeps: clang-10
90             Repo: llvm-toolchain-$(lsb_release -cs)-10
91             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
92             os: ubuntu-20.04
93           - CC: clang-11
94             CXX: clang++-11
95             PackageDeps: clang-11
96             Repo: llvm-toolchain-$(lsb_release -cs)-11
97             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
98             os: ubuntu-20.04
99           - CC: clang-12
100             CXX: clang++-12
101             PackageDeps: clang-12
102             Repo: llvm-toolchain-$(lsb_release -cs)-12
103             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
104             os: ubuntu-20.04
105           - CC: clang-13
106             CXX: clang++-13
107             PackageDeps: clang-13
108             Repo: llvm-toolchain-$(lsb_release -cs)-13
109             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
110             os: ubuntu-20.04
111           - CC: clang-14
112             CXX: clang++-14
113             PackageDeps: clang-14
114             Repo: llvm-toolchain-$(lsb_release -cs)-14
115             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
116             os: ubuntu-22.04
117           - CC: clang-15
118             CXX: clang++-15
119             PackageDeps: clang-15
120             Repo: llvm-toolchain-$(lsb_release -cs)-15
121             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
122             os: ubuntu-22.04
123           - CC: clang-16
124             CXX: clang++-16
125             PackageDeps: clang-16
126             Repo: llvm-toolchain-$(lsb_release -cs)-16
127             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
128             os: ubuntu-22.04
129           - feature: CORBA/e micro
130             CC: gcc-10
131             CXX: g++-10
132             PackageDeps: g++-10
133             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
134             os: ubuntu-20.04
135             optional_feature: corba_e_micro=1
136             optional_macros: corba_e_micro=1
137           - feature: CORBA/e compact
138             CC: gcc-10
139             CXX: g++-10
140             PackageDeps: g++-10
141             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
142             os: ubuntu-20.04
143             optional_feature: corba_e_compact=1
144             optional_macros: corba_e_compact=1
145           - feature: ACE for TAO
146             CC: gcc-10
147             CXX: g++-10
148             PackageDeps: g++-10
149             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
150             os: ubuntu-20.04
151             optional_feature: ace_for_tao=1
152             optional_macros: ace_for_tao=1
153           - feature: wchar
154             CC: gcc-10
155             CXX: g++-10
156             PackageDeps: g++-10
157             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
158             os: ubuntu-20.04
159             optional_feature: uses_wchar=1
160             optional_macros: inline=0
161           - feature: CodeQL
162             CC: gcc-10
163             CXX: g++-10
164             PackageDeps: g++-10
165             platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
166             os: ubuntu-20.04
167     runs-on: ${{ matrix.os }}
168     name: ${{ matrix.os }} ${{ matrix.CXX }} ${{ matrix.feature }}
169     env:
170       ACE_ROOT: ${{ github.workspace }}/ACE
171       TAO_ROOT: ${{ github.workspace }}/TAO
172       MPC_ROOT: ${{ github.workspace }}/MPC
173       CC: ${{ matrix.CC }}
174       CXX: ${{ matrix.CXX }}
175     steps:
176     - name: Checkout ACE_TAO
177       uses: actions/checkout@v4
178     - name: Checkout MPC
179       uses: actions/checkout@v4
180       with:
181         repository: DOCGroup/MPC
182         path: ${{ env.MPC_ROOT }}
183     - name: Add LLVM apt repo ${{ matrix.Repo }}
184       run: |
185         wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
186         sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ ${{ matrix.Repo }} main"
187       if: startsWith (matrix.Repo, 'llvm-toolchain')
188     - name: Add PPA apt repo ${{ matrix.Repo }}
189       run: |
190         sudo apt-add-repository ${{ matrix.Repo }}
191       if: startsWith (matrix.Repo, 'ppa:')
192     - name: Add apt packages ${{ matrix.PackageDeps }}
193       run: |
194         sudo apt-get --yes update
195         sudo apt-get --yes install libxerces-c-dev libssl-dev ${{ matrix.PackageDeps }}
196     - name: Create $ACE_ROOT/ace/config.h
197       run: |
198         '#include "ace/config-linux.h"' > ${env:ACE_ROOT}/ace/config.h
199       shell: pwsh
200     - name: Create $ACE_ROOT/include/makeinclude/platform_macros.GNU
201       run: |
202         'ipv6=1' > ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
203         'xerces3=1' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
204         'ssl=1' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
205         'INSTALL_PREFIX = ${{ github.workspace }}/installed' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
206       shell: pwsh
207     - name: Add optional platform macros
208       run: |
209         '${{ matrix.optional_macros }}' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
210       shell: pwsh
211       if: matrix.optional_macros != ''
212     - name: Extend $ACE_ROOT/include/makeinclude/platform_macros.GNU
213       run: |
214         '${{ matrix.platform_file }}' >> ${env:ACE_ROOT}/include/makeinclude/platform_macros.GNU
215       shell: pwsh
216     - name: Create $ACE_ROOT/bin/MakeProjectCreator/config/default.features
217       run: |
218         'ipv6=1' > ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
219         'xerces3=1' >> ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
220         'ssl=1' >> ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
221         'versioned_namespace=1' >> ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
222       shell: pwsh
223     - name: Add optional MPC features
224       run: |
225         '${{ matrix.optional_feature }}' >> ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features
226       if: matrix.optional_feature != ''
227       shell: pwsh
228     - name: Initialize CodeQL
229       uses: github/codeql-action/init@v3
230       with:
231         languages: cpp
232       if: matrix.feature == 'CodeQL'
233     - name: Run mwc.pl on $(TAO_ROOT)/TAO_ACE.mwc
234       run: |
235         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:TAO_ROOT}/TAO_ACE.mwc -workers 4
236       shell: pwsh
237     - name: Run mwc.pl on $(ACE_ROOT)/tests/tests.mwc
238       run: |
239         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:ACE_ROOT}/tests/tests.mwc -workers 4
240       shell: pwsh
241     - name: Run mwc.pl on $(TAO_ROOT)/tests/IDL_Test
242       run: |
243         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:TAO_ROOT}/tests/IDL_Test -workers 4
244       shell: pwsh
245     - name: Run mwc.pl on $(TAO_ROOT)/tests/IDLv4
246       run: |
247         perl ${env:ACE_ROOT}/bin/mwc.pl -type gnuace ${env:TAO_ROOT}/tests/IDLv4 -workers 4
248       shell: pwsh
249     - name: Build TAO_ACE workspace
250       run: |
251         make -j 6 -C ${env:TAO_ROOT}
252       shell: pwsh
253     - name: Build ACE/tests workspace
254       run: |
255         make -j 6 -C ${env:ACE_ROOT}/tests
256       shell: pwsh
257     - name: Build TAO/tests/IDL_Test project
258       run: |
259         make -j 6 -C ${env:TAO_ROOT}/tests/IDL_Test
260       shell: pwsh
261       if: matrix.feature != 'CORBA/e micro'
262     - name: Build TAO/tests/IDLv4 project
263       run: |
264         make -j 6 -C ${env:TAO_ROOT}/tests/IDLv4
265       shell: pwsh
266     - name: Perform CodeQL Analysis
267       uses: github/codeql-action/analyze@v3
268       if: matrix.feature == 'CodeQL'
269     - name: Install TAO_ACE workspace
270       run: |
271         make -C ${env:TAO_ROOT} install
272       shell: pwsh
273     - name: Test pkgconfig
274       if: matrix.CheckPkgConfig
275       run: |
276         cd ${{ github.workspace }}/installed/lib/pkgconfig
277         export PKG_CONFIG_PATH=.
278         for f in *.pc; do pkg-config --print-errors --exists ${f%.pc}; done