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