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