• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Linux
2
3on: [push, pull_request]
4
5jobs:
6  compatibility:
7    runs-on: ubuntu-18.04
8    container: streamhpc/opencl-sdk-base:ubuntu-18.04-20220127
9    strategy:
10      matrix:
11        # TODO: CMake 3.0.2 is Headers minimum (and ubuntu 18.04 canonical apt repo ver), not this repo's min
12        # Replace once backport to C++14 happened
13        include:
14          # Unix Makefiles
15            # One CMake version
16            # For all compilers
17              # For all configurations
18                # For all target architectures
19          - C_COMPILER: gcc-7
20            CXX_COMPILER: g++-7
21            CMAKE: 3.0.2
22            GEN: Unix Makefiles
23            CONFIG: Debug
24            BIN: 64
25          - C_COMPILER: gcc-7
26            CXX_COMPILER: g++-7
27            CMAKE: 3.0.2
28            GEN: Unix Makefiles
29            CONFIG: Release
30            BIN: 64
31          - C_COMPILER: gcc-7
32            CXX_COMPILER: g++-7
33            CMAKE: 3.0.2
34            GEN: Unix Makefiles
35            CONFIG: Debug
36            BIN: 32
37          - C_COMPILER: gcc-7
38            CXX_COMPILER: g++-7
39            CMAKE: 3.0.2
40            GEN: Unix Makefiles
41            CONFIG: Release
42            BIN: 32
43          - C_COMPILER: gcc-11
44            CXX_COMPILER: g++-11
45            CMAKE: 3.0.2
46            GEN: Unix Makefiles
47            CONFIG: Debug
48            BIN: 64
49          - C_COMPILER: gcc-11
50            CXX_COMPILER: g++-11
51            CMAKE: 3.0.2
52            GEN: Unix Makefiles
53            CONFIG: Release
54            BIN: 64
55          - C_COMPILER: gcc-11
56            CXX_COMPILER: g++-11
57            CMAKE: 3.0.2
58            GEN: Unix Makefiles
59            CONFIG: Debug
60            BIN: 32
61          - C_COMPILER: gcc-11
62            CXX_COMPILER: g++-11
63            CMAKE: 3.0.2
64            GEN: Unix Makefiles
65            CONFIG: Release
66            BIN: 32
67          - C_COMPILER: clang-8
68            CXX_COMPILER: clang++-8
69            CMAKE: 3.0.2
70            GEN: Unix Makefiles
71            CONFIG: Debug
72            BIN: 64
73          - C_COMPILER: clang-8
74            CXX_COMPILER: clang++-8
75            CMAKE: 3.0.2
76            GEN: Unix Makefiles
77            CONFIG: Release
78            BIN: 64
79          - C_COMPILER: clang-8
80            CXX_COMPILER: clang++-8
81            CMAKE: 3.0.2
82            GEN: Unix Makefiles
83            CONFIG: Debug
84            BIN: 32
85          - C_COMPILER: clang-8
86            CXX_COMPILER: clang++-8
87            CMAKE: 3.0.2
88            GEN: Unix Makefiles
89            CONFIG: Release
90            BIN: 32
91          - C_COMPILER: clang-13
92            CXX_COMPILER: clang++-13
93            CMAKE: 3.0.2
94            GEN: Unix Makefiles
95            CONFIG: Debug
96            BIN: 64
97          - C_COMPILER: clang-13
98            CXX_COMPILER: clang++-13
99            CMAKE: 3.0.2
100            GEN: Unix Makefiles
101            CONFIG: Release
102            BIN: 64
103          - C_COMPILER: clang-13
104            CXX_COMPILER: clang++-13
105            CMAKE: 3.0.2
106            GEN: Unix Makefiles
107            CONFIG: Debug
108            BIN: 32
109          - C_COMPILER: clang-13
110            CXX_COMPILER: clang++-13
111            CMAKE: 3.0.2
112            GEN: Unix Makefiles
113            CONFIG: Release
114            BIN: 32
115          # Multi-config generators
116            # One CMake version
117            # For all compilers
118              # For all architectures
119          - C_COMPILER: gcc-7
120            CXX_COMPILER: g++-7
121            CMAKE: 3.22.1
122            GEN: Ninja Multi-Config
123            BIN: 64
124          - C_COMPILER: gcc-7
125            CXX_COMPILER: g++-7
126            CMAKE: 3.22.1
127            GEN: Ninja Multi-Config
128            BIN: 32
129          - C_COMPILER: gcc-11
130            CXX_COMPILER: g++-11
131            CMAKE: 3.22.1
132            GEN: Ninja Multi-Config
133            BIN: 64
134          - C_COMPILER: gcc-11
135            CXX_COMPILER: g++-11
136            CMAKE: 3.22.1
137            GEN: Ninja Multi-Config
138            BIN: 32
139          - C_COMPILER: clang-8
140            CXX_COMPILER: clang++-8
141            CMAKE: 3.22.1
142            GEN: Ninja Multi-Config
143            BIN: 64
144          - C_COMPILER: clang-8
145            CXX_COMPILER: clang++-8
146            CMAKE: 3.22.1
147            GEN: Ninja Multi-Config
148            BIN: 32
149          - C_COMPILER: clang-13
150            CXX_COMPILER: clang++-13
151            CMAKE: 3.22.1
152            GEN: Ninja Multi-Config
153            BIN: 64
154          - C_COMPILER: clang-13
155            CXX_COMPILER: clang++-13
156            CMAKE: 3.22.1
157            GEN: Ninja Multi-Config
158            BIN: 32
159    env:
160      CMAKE_EXE: /opt/Kitware/CMake/${{ matrix.CMAKE }}/bin/cmake
161      CTEST_EXE: /opt/Kitware/CMake/${{ matrix.CMAKE }}/bin/ctest
162
163    steps:
164    - name: Checkout OpenCL-Headers
165      uses: actions/checkout@v2
166
167    - name: Configure
168      shell: bash
169      run: $CMAKE_EXE
170        -G "${{matrix.GEN}}"
171        -D BUILD_TESTING=ON
172        `if [[ "${{matrix.GEN}}" == "Unix Makefiles" ]]; then echo -D CMAKE_BUILD_TYPE=${{matrix.CONFIG}}; fi;`
173        -D CMAKE_C_FLAGS="-Wall -Wextra -pedantic -Werror -m${{matrix.BIN}}"
174        -D CMAKE_C_COMPILER=${{matrix.C_COMPILER}}
175        -D CMAKE_C_EXTENSIONS=OFF
176        -D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror -m${{matrix.BIN}}"
177        -D CMAKE_CXX_COMPILER=${{matrix.CXX_COMPILER}}
178        -D CMAKE_CXX_EXTENSIONS=OFF
179        -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install
180        -B$GITHUB_WORKSPACE/build
181        -H$GITHUB_WORKSPACE
182
183    - name: Build
184      shell: bash
185      run: if [[ "${{matrix.GEN}}" == "Unix Makefiles" ]];
186        then
187          $CMAKE_EXE --build $GITHUB_WORKSPACE/build -- -j`nproc`;
188        else
189          $CMAKE_EXE --build $GITHUB_WORKSPACE/build --config Debug   -- -j`nproc`;
190          $CMAKE_EXE --build $GITHUB_WORKSPACE/build --config Release -- -j`nproc`;
191        fi;
192
193    - name: Test
194      shell: bash
195      working-directory: ${{runner.workspace}}/OpenCL-Headers/build
196      run: if [[ "${{matrix.GEN}}" == "Unix Makefiles" ]];
197        then
198          $CTEST_EXE --output-on-failure --parallel `nproc`;
199        else
200          $CTEST_EXE --output-on-failure -C Debug   --parallel `nproc`;
201          $CTEST_EXE --output-on-failure -C Release --parallel `nproc`;
202        fi;