aboutsummaryrefslogtreecommitdiff
path: root/third_party/vulkan-deps/glslang/src/.github/workflows/continuous_integration.yml
blob: ab944dc55fa394aec6ead382bfaf163ac688d3a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Continuous Integration

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main

permissions: read-all

jobs:
  linux:
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
        cmake_build_type: [Debug, Release]
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
        with:
          python-version: '3.7'
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
      - run: ./update_glslang_sources.py
      - name: Configure
        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
        env:
          CC: ${{matrix.compiler.cc}}
          CXX: ${{matrix.compiler.cxx}}
          CMAKE_GENERATOR: Ninja
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
      - name: Build
        run: cmake --build build
      - name: Install
        run: cmake --install build --prefix build/install
      - name: Test
        run: ctest --output-on-failure --test-dir build
      - name: Test (standalone)
        run: cd Test && ./runtests

  linux-asan:
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        compiler: [{cc: gcc, cxx: g++}]
        cmake_build_type: [Debug]
        flags: ['-fsanitize=address', '-fsanitize=thread']
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
        with:
          python-version: '3.7'
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}}
      # This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer
      # https://github.com/google/sanitizers/issues/1716
      - run: sudo sysctl vm.mmap_rnd_bits=28
      - run: ./update_glslang_sources.py
      - name: Configure
        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -D GLSLANG_TESTS=ON
        env:
          CC: ${{matrix.compiler.cc}}
          CXX: ${{matrix.compiler.cxx}}
          CMAKE_GENERATOR: Ninja
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
          CFLAGS: ${{matrix.flags}}
          CXXFLAGS: ${{matrix.flags}}
          LDFLAGS: ${{matrix.flags}}
      - name: Build
        run: cmake --build build
      - name: Install
        run: cmake --install build --prefix build/install
      - name: Test
        run: ctest --output-on-failure --test-dir build
      - name: Test (standalone)
        run: cd Test && ./runtests

  # Ensure we can compile/run on an older distro
  linux_min:
    name: Linux Backcompat
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
        with:
          python-version: '3.7'
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
        with:
          cmakeVersion: 3.17.2
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: linux_backcompat
      - run: ./update_glslang_sources.py
      - name: Configure
        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D GLSLANG_TESTS=ON
        env:
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
      - name: Build
        run: cmake --build build
      - name: Install
        run: cmake --install build --prefix build/install
      - name: Test
        run: ctest --output-on-failure --test-dir build
      - name: Test (standalone)
        run: cd Test && ./runtests

  macos:
    runs-on: ${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-12, macos-13]
        compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
        cmake_build_type: [Debug, Release]
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - run: ./update_glslang_sources.py
      - run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G Ninja -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
        env:
          CC: ${{matrix.compiler.cc}}
          CXX: ${{matrix.compiler.cxx}}
      - run: cmake --build build
      - run: cmake --install build --prefix build/install
      - run: ctest --output-on-failure --test-dir build
      - name: Test Script (standalone)
        run: ./runtests
        working-directory: Test

  windows:
    runs-on: ${{matrix.os.genus}}
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
          os: [{genus: windows-2019, family: windows}]
          cmake_build_type: [Debug, Release]
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
        with:
          python-version: '3.7'
      - run: python update_glslang_sources.py
      - name: Build
        run: |
          cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
          cmake --build build --config ${{matrix.cmake_build_type}} --target install
      - name: Test
        run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
      - name: Test (standalone)
        run: bash -c 'cd ./Test && ./runtests'

  iOS:
    runs-on: macos-13
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: IOS
      - run: ./update_glslang_sources.py
      # NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
      - name: Configure Universal Binary for iOS
        run: |
          cmake -S . -B build \
          -D CMAKE_BUILD_TYPE=Debug \
          -D CMAKE_SYSTEM_NAME=iOS \
          "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
          -G Ninja
        env:
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
      - run: cmake --build build
      - run: cmake --install build --prefix /tmp

  android:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        # Android NDK currently offers 2 different toolchains.
        # Test both to ensure we are compatible with either approach.
        LEGACY: [ON, OFF]
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: android-${{ matrix.LEGACY }}
      - run: ./update_glslang_sources.py
      - name: Configure for Android
        run: |
          cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
          -D CMAKE_BUILD_TYPE=Release \
          -D ANDROID_ABI=armeabi-v7a \
          -D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
          -G Ninja
        env:
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
      - run: cmake --build build/
      - run: cmake --install build/ --prefix /tmp

  emscripten:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
      - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
        with:
          python-version: '3.7'
      - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
      - name: Setup ccache
        uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13
        with:
          key: ubuntu-emscripten
      - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
      - name: Update Glslang Sources
        run: ./update_glslang_sources.py
      - name: Configure
        run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DENABLE_OPT=OFF
        env:
          CMAKE_GENERATOR: Ninja
          CMAKE_C_COMPILER_LAUNCHER: ccache
          CMAKE_CXX_COMPILER_LAUNCHER: ccache
      - name: Build
        run: cmake --build build/web