yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

dependabot[bot]Bump lukka/get-cmake from 4.4.2 to 4.4.478ff51b7

main
12.8 KiB339 linesraw
1name: Continuous Integration
2
3on:
4  workflow_dispatch:
5  pull_request:
6    branches:
7      - main
8
9permissions: read-all
10
11jobs:
12  linux:
13    needs: linux-shared # fastest job to do sanity check
14    runs-on: ubuntu-22.04
15    strategy:
16      fail-fast: false
17      matrix:
18        compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
19        cmake_build_type: [Debug, Release]
20    steps:
21      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22      - name: Setup ccache
23        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
24        with:
25          key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
26      - run: ./update_glslang_sources.py
27      - name: Configure
28        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
29        env:
30          CC: ${{matrix.compiler.cc}}
31          CXX: ${{matrix.compiler.cxx}}
32          CMAKE_GENERATOR: Ninja
33          CMAKE_C_COMPILER_LAUNCHER: ccache
34          CMAKE_CXX_COMPILER_LAUNCHER: ccache
35      - name: Build
36        run: cmake --build build
37      - name: Install
38        run: cmake --install build --prefix build/install
39      - name: Test find_package support
40        run: |
41          cmake -S Test/find_package -B build/find_package && \
42          cmake --build build/find_package
43      - name: Test
44        run: ctest --output-on-failure --test-dir build
45      - name: Check known validation failure list
46        run: grep -l 'Validation failed' Test/baseResults/* | sort -fd | diff -u Test/baseResults/validation_fails.txt -
47
48  linux-shared:
49    runs-on: ubuntu-22.04
50    strategy:
51      fail-fast: false
52      matrix:
53        compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
54        cmake_build_type: [Release]
55    steps:
56      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
57      - name: Setup ccache
58        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
59        with:
60          key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
61      - run: ./update_glslang_sources.py
62      - name: Configure
63        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
64        env:
65          CC: ${{matrix.compiler.cc}}
66          CXX: ${{matrix.compiler.cxx}}
67          CMAKE_GENERATOR: Ninja
68          CMAKE_C_COMPILER_LAUNCHER: ccache
69          CMAKE_CXX_COMPILER_LAUNCHER: ccache
70      - name: Build
71        run: cmake --build build
72      - name: Install
73        run: cmake --install build --prefix build/install
74      - name: Test find_package support
75        run: |
76          cmake -S Test/find_package -B build/find_package && \
77          cmake --build build/find_package
78      - name: Test
79        run: ctest --output-on-failure --test-dir build
80
81  linux-asan:
82    needs: linux-shared # fastest job to do sanity check
83    runs-on: ubuntu-22.04
84    strategy:
85      fail-fast: false
86      matrix:
87        compiler: [{cc: gcc, cxx: g++}]
88        cmake_build_type: [Debug]
89        flags: ['-fsanitize=address', '-fsanitize=thread', '-fsanitize=undefined']
90    steps:
91      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
92      - name: Setup ccache
93        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
94        with:
95          key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}}
96      # This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer
97      # https://github.com/google/sanitizers/issues/1716
98      - run: sudo sysctl vm.mmap_rnd_bits=28
99      - run: ./update_glslang_sources.py
100      - name: Configure
101        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -D GLSLANG_TESTS=ON
102        env:
103          CC: ${{matrix.compiler.cc}}
104          CXX: ${{matrix.compiler.cxx}}
105          CMAKE_GENERATOR: Ninja
106          CMAKE_C_COMPILER_LAUNCHER: ccache
107          CMAKE_CXX_COMPILER_LAUNCHER: ccache
108          CFLAGS: ${{matrix.flags}}
109          CXXFLAGS: ${{matrix.flags}}
110          LDFLAGS: ${{matrix.flags}}
111      - name: Build
112        run: cmake --build build
113      - name: Install
114        run: cmake --install build --prefix build/install
115      - name: Test
116        env:
117          UBSAN_OPTIONS: 'halt_on_error=1:print_stacktrace=1'
118        run: ctest --output-on-failure --test-dir build
119
120  # Ensure we can compile/run on an older distro, with older tools (cmake, python, etc)
121  linux_min:
122    needs: linux-shared # fastest job to do sanity check
123    name: Linux Backcompat
124    runs-on: ubuntu-22.04
125    steps:
126      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
127      - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
128        with:
129          python-version: '3.7'
130      - uses: lukka/get-cmake@a89e43e22a96abafcd7a62db652a65ecd33052c9 # v4.4.4
131        with:
132          cmakeVersion: 3.22.1
133      - name: Setup ccache
134        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
135        with:
136          key: linux_backcompat
137      - run: ./update_glslang_sources.py
138      - name: Configure
139        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D GLSLANG_TESTS=ON
140        env:
141          CMAKE_C_COMPILER_LAUNCHER: ccache
142          CMAKE_CXX_COMPILER_LAUNCHER: ccache
143      - name: Build
144        run: cmake --build build
145      - name: Install
146        run: cmake --install build --prefix build/install
147      - name: Test find_package support
148        run: |
149          cmake -S Test/find_package -B build/find_package && \
150          cmake --build build/find_package
151      - name: Test
152        run: ctest --output-on-failure --test-dir build
153
154  macos:
155    # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
156    needs: windows-shared
157    runs-on: ${{matrix.os}}
158    strategy:
159      fail-fast: false
160      matrix:
161        os: [macos-latest]
162        compiler: [{cc: clang, cxx: clang++}]
163        cmake_build_type: [Debug, Release]
164    steps:
165      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
166      - run: ./update_glslang_sources.py
167      - run: |
168          cmake -S . -B build \
169          -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} \
170          -G Ninja \
171          -D BUILD_WERROR=ON \
172          -D GLSLANG_TESTS=ON \
173          -D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
174        env:
175          CC: ${{matrix.compiler.cc}}
176          CXX: ${{matrix.compiler.cxx}}
177          MACOSX_DEPLOYMENT_TARGET: 11.0
178      - run: cmake --build build
179      - run: cmake --install build --prefix build/install
180      - name: Test find_package support
181        run: |
182          cmake -S Test/find_package -B build/find_package && \
183          cmake --build build/find_package
184      - run: ctest --output-on-failure --test-dir build
185
186  macos-shared:
187    # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
188    needs: windows-shared
189    runs-on: ${{matrix.os}}
190    strategy:
191      fail-fast: false
192      matrix:
193        os: [macos-latest]
194        compiler: [{cc: clang, cxx: clang++}]
195        cmake_build_type: [Release]
196    steps:
197      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
198      - run: ./update_glslang_sources.py
199      - run: |
200          cmake -S . -B build \
201          -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} \
202          -G Ninja \
203          -D BUILD_WERROR=ON \
204          -D GLSLANG_TESTS=ON \
205          -DBUILD_SHARED_LIBS=ON \
206          -D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
207        env:
208          CC: ${{matrix.compiler.cc}}
209          CXX: ${{matrix.compiler.cxx}}
210          MACOSX_DEPLOYMENT_TARGET: 11.0
211      - run: cmake --build build
212      - run: cmake --install build --prefix build/install
213      - name: Test find_package support
214        run: |
215          cmake -S Test/find_package -B build/find_package && \
216          cmake --build build/find_package
217      - run: ctest --output-on-failure --test-dir build
218
219  windows:
220    needs: linux-shared # fastest job to do sanity check
221    runs-on: ${{matrix.os.genus}}
222    permissions:
223      contents: write
224    strategy:
225      fail-fast: false
226      matrix:
227          os: [{genus: windows-2022, family: windows}]
228          cmake_build_type: [Debug, Release]
229    steps:
230      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
231      - run: python update_glslang_sources.py
232      - name: Build
233        run: |
234          cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
235          cmake --build build --config ${{matrix.cmake_build_type}} --target install
236      - name: Test find_package support
237        run: |
238          cmake -S Test/find_package -B build/find_package
239          cmake --build build/find_package
240      - name: Test
241        run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
242
243  windows-shared:
244    needs: linux-shared # fastest job to do sanity check
245    runs-on: ${{matrix.os.genus}}
246    permissions:
247      contents: write
248    strategy:
249      fail-fast: false
250      matrix:
251          os: [{genus: windows-2022, family: windows}]
252          cmake_build_type: [Debug, Release]
253    steps:
254      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
255      - run: python update_glslang_sources.py
256      - name: Build
257        run: |
258          cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
259          cmake --build build --config ${{matrix.cmake_build_type}} --target install
260      - name: Test find_package support
261        run: |
262          cmake -S Test/find_package -B build/find_package
263          cmake --build build/find_package
264      - name: Test
265        run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
266
267  iOS:
268    # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
269    needs: windows-shared
270    runs-on: macos-latest
271    steps:
272      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
273      - name: Setup ccache
274        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
275        with:
276          key: IOS
277      - run: ./update_glslang_sources.py
278      # NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
279      - name: Configure Universal Binary for iOS
280        run: |
281          cmake -S . -B build \
282          -D CMAKE_BUILD_TYPE=Debug \
283          -D CMAKE_SYSTEM_NAME=iOS \
284          "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
285          -G Ninja
286        env:
287          CMAKE_C_COMPILER_LAUNCHER: ccache
288          CMAKE_CXX_COMPILER_LAUNCHER: ccache
289      - run: cmake --build build
290      - run: cmake --install build --prefix /tmp
291
292  android:
293    needs: linux-shared # fastest job to do sanity check
294    runs-on: ubuntu-22.04
295    strategy:
296      matrix:
297        # Android NDK currently offers 2 different toolchains.
298        # Test both to ensure we are compatible with either approach.
299        LEGACY: [ON, OFF]
300    steps:
301      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
302      - name: Setup ccache
303        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
304        with:
305          key: android-${{ matrix.LEGACY }}
306      - run: ./update_glslang_sources.py
307      - name: Configure for Android
308        run: |
309          cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
310          -D CMAKE_BUILD_TYPE=Release \
311          -D ANDROID_ABI=armeabi-v7a \
312          -D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
313          -G Ninja
314        env:
315          CMAKE_C_COMPILER_LAUNCHER: ccache
316          CMAKE_CXX_COMPILER_LAUNCHER: ccache
317      - run: cmake --build build/
318      - run: cmake --install build/ --prefix /tmp
319
320  emscripten:
321    needs: linux-shared # fastest job to do sanity check
322    runs-on: ubuntu-22.04
323    steps:
324      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
325      - name: Setup ccache
326        uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
327        with:
328          key: ubuntu-emscripten
329      - uses: emscripten-core/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
330      - name: Update Glslang Sources
331        run: ./update_glslang_sources.py
332      - name: Configure
333        run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DENABLE_OPT=OFF
334        env:
335          CMAKE_GENERATOR: Ninja
336          CMAKE_C_COMPILER_LAUNCHER: ccache
337          CMAKE_CXX_COMPILER_LAUNCHER: ccache
338      - name: Build
339        run: cmake --build build/web