1313 - ' doc/**'
1414 - ' tools/**'
1515
16- env :
17- BUILD_TYPE : MinSizeRel
18- NDK_VER : 21.3.6528147
19- NDK_ARCH : x86_64
20- NDK_API : 29
21-
2216jobs :
17+ define-matrix :
18+ runs-on : ubuntu-latest
19+
20+ outputs :
21+ hosts : ${{ steps.matrix.outputs.hosts }}
22+ containers : ${{ steps.matrix.outputs.containers }}
23+
24+ steps :
25+ - name : Define Matrix
26+ id : matrix
27+ shell : python
28+ run : |
29+ import json
30+ import os
31+
32+ macos_map = {
33+ 'macos-14': "15.4",
34+ 'macos-15': "16.2"
35+ }
36+
37+ win_paltforms = ["x64", "Win32"]
38+ win_clang_archs = ["x64", "x86"]
39+
40+ gcc_map = {
41+ 11: 'ubuntu-22.04',
42+ 12: 'ubuntu-latest',
43+ 13: 'ubuntu-latest',
44+ 14: 'ubuntu-24.04'
45+ }
46+ gcc_cont_map = {
47+ 15: 'gcc:15.1'
48+ }
49+ clang_map = {
50+ 13: 'ubuntu-22.04',
51+ 14: 'ubuntu-22.04',
52+ 15: 'ubuntu-22.04',
53+ 16: 'ubuntu-22.04',
54+ 17: 'ubuntu-latest',
55+ 18: 'ubuntu-latest',
56+ 19: 'ubuntu-latest',
57+ 20: 'ubuntu-latest',
58+ 21: 'ubuntu-latest'
59+ }
60+
61+ hosts = []
62+ containers=[]
63+
64+ #macOS
65+ for runon, xcode in macos_map.items():
66+ hosts.append({'os': runon, 'version': xcode, 'jobname': f'macOS - Xcode{xcode}'})
67+
68+ #windows
69+ for platform in win_paltforms:
70+ hosts.append({'os': 'windows-latest', 'platform': platform, 'nopython': platform == "Win32", 'jobname': f'Windows - {platform}'})
71+
72+ for arch in win_clang_archs:
73+ hosts.append({'os': 'windows-latest', 'arch': arch, 'compiler': 'clang-cl', 'nopython': arch == "x86", 'jobname': f'Windows - clang - {arch}'})
74+
75+ #gcc hosts
76+ for gcc, runon in gcc_map.items():
77+ hosts.append({'os': runon, 'compiler': 'gcc', 'version': gcc, 'jobname': f'Linux - GCC{gcc}'})
78+
79+ #gcc containers
80+ for gcc, container in gcc_cont_map.items():
81+ containers.append({'container': container, 'jobname': f'Linux - GCC{gcc}'})
82+
83+
84+ #clang
85+ for clang, runon in clang_map.items():
86+ hosts.append({'os': runon, 'compiler': 'clang', 'version': clang, 'jobname': f'Linux - Clang{clang}'})
87+
88+ with open(os.environ['GITHUB_OUTPUT'], 'w') as env:
89+ print('hosts=' + json.dumps(hosts), file=env)
90+ print('containers=' + json.dumps(containers), file=env)
91+
2392 desktop :
93+ needs : define-matrix
94+ name : ${{ matrix.jobname }}
2495 runs-on : ${{ matrix.os }}
2596 strategy :
2697 fail-fast : false
2798 matrix :
28- include :
29- - {os: macos-15, version: 16 }
30- - {os: macos-14, version: "15.4" }
31-
32- - os : windows-latest
33-
34- - {os: ubuntu-22.04, compiler: gcc, version: 11 }
35- - {os: ubuntu-22.04, compiler: gcc, version: 12 }
36- - {os: ubuntu-22.04, compiler: gcc, version: 13 }
37- - {os: ubuntu-24.04, compiler: gcc, version: 14 }
38- # - {os: ubuntu-24.04, compiler: gcc, version: 15 }
39-
40- - {os: ubuntu-22.04, compiler: clang, version: 13 }
41- - {os: ubuntu-22.04, compiler: clang, version: 14 }
42- - {os: ubuntu-22.04, compiler: clang, version: 15 }
43- - {os: ubuntu-22.04, compiler: clang, version: 16 }
44- - {os: ubuntu-latest, compiler: clang, version: 17 }
45- - {os: ubuntu-latest, compiler: clang, version: 18 }
46- - {os: ubuntu-latest, compiler: clang, version: 19 }
47- - {os: ubuntu-latest, compiler: clang, version: 20 }
99+ include : ${{ fromJSON(needs.define-matrix.outputs.hosts) }}
48100
49101 steps :
50102 - name : Checkout
@@ -72,29 +124,61 @@ jobs:
72124 echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
73125 fi
74126
127+ mkdir bin
128+ wget -qO- https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip | \
129+ gunzip > bin/ninja
130+ chmod a+x bin/ninja
131+ echo PATH=`pwd`/bin:$PATH >> $GITHUB_ENV
132+ echo "CMAKE_GENERATOR=-GNinja" >> $GITHUB_ENV
75133 fi
134+
76135 if [[ '${{ matrix.os }}' == macos-* ]]; then
77136 brew install icu4c
78137 echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.version }}.app" >> $GITHUB_ENV
79138 echo "ICU_ROOT=$(brew --cellar icu4c)/$(brew info --json icu4c | jq -r '.[0].installed[0].version')" >> $GITHUB_ENV
80139 fi
81140
141+ if [[ '${{ matrix.os }}' == windows-* ]]; then
142+ if [[ '${{ matrix.compiler }}' != '' ]]; then
143+ if [[ '${{ matrix.arch }}' == "x64" ]]; then
144+ VCPREFIX="C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\Llvm\\x64\\bin"
145+ else
146+ VCPREFIX="C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\Llvm\\bin"
147+ fi
148+ echo "CC=$VCPREFIX\\${{ matrix.compiler }}" >> $GITHUB_ENV
149+ echo "CXX=$VCPREFIX\\${{ matrix.compiler }}" >> $GITHUB_ENV
150+ echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
151+ fi
152+ fi
153+
154+ CMAKE_ARGS=( )
155+
156+ if [[ '${{ matrix.platform }}' != "" ]]; then
157+ CMAKE_ARGS+=(-DCMAKE_GENERATOR_PLATFORM=${{ matrix.platform }})
158+ fi
159+
160+ if [[ ${#CMAKE_ARGS[@]} != 0 ]]; then
161+ echo "CMAKE_ARGS=${CMAKE_ARGS[@]}" >> $GITHUB_ENV
162+ fi
163+
82164 - name : Configure
83165 shell : bash
84166 run : |
85- cmake -S . -B out -DCMAKE_BUILD_TYPE=$BUILD_TYPE
167+ cmake $CMAKE_GENERATOR -S . -B out $CMAKE_ARGS -DCMAKE_BUILD_TYPE=MinSizeRel
86168
87169 - name : Build and Test
88170 shell : bash
89- run : cmake --build out --config $BUILD_TYPE --target run-test
171+ run : cmake --build out --config MinSizeRel --target run-test
90172
91173 container :
174+ needs : define-matrix
175+ name : ${{ matrix.jobname }}
92176 runs-on : ubuntu-latest
93177 container : ${{ matrix.container }}
94178 strategy :
95179 fail-fast : false
96180 matrix :
97- container : [gcc:15.1]
181+ include : ${{ fromJSON(needs.define-matrix.outputs.containers) }}
98182
99183 steps :
100184 - name : Checkout
@@ -109,14 +193,46 @@ jobs:
109193 - name : Configure
110194 shell : bash
111195 run : |
112- cmake -S . -B out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
196+ cmake -S . -B out -DCMAKE_BUILD_TYPE=MinSizeRel
197+
198+ - name : Build and Test
199+ shell : bash
200+ run : cmake --build out --config MinSizeRel --target run-test
201+
202+
203+ big-endian :
204+ runs-on : ubuntu-latest
205+
206+ steps :
207+ - name : Checkout
208+ uses : actions/checkout@v4
209+
210+ - name : Setup
211+ run : |
212+ sudo apt-get update
213+ sudo apt-get install -y gcc-powerpc-linux-gnu g++-powerpc-linux-gnu qemu-user-binfmt
214+
215+ - name : Configure
216+ run : |
217+ export CC=powerpc-linux-gnu-gcc
218+ export CXX=powerpc-linux-gnu-g++
219+ export QEMU_LD_PREFIX=/usr/powerpc-linux-gnu/
220+ cmake -S . -B out -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_SYSTEM_PROCESSOR=powerpc
113221
114222 - name : Build and Test
115223 shell : bash
116- run : cmake --build out --config ${{env.BUILD_TYPE}} --target run-test
224+ run : |
225+ export QEMU_LD_PREFIX=/usr/powerpc-linux-gnu/
226+ cmake --build out --config MinSizeRel --target run-test
117227
118228 android :
119229 runs-on : ubuntu-latest
230+ strategy :
231+ fail-fast : false
232+ matrix :
233+ version : [27.2.12479018]
234+ api : [29, 30]
235+ arch : [x86_64]
120236
121237 steps :
122238 - name : Checkout
@@ -135,36 +251,36 @@ jobs:
135251 path : |
136252 ~/.android/avd/*
137253 ~/.android/adb*
138- key : avd-${{env.NDK_VER }}-${{env.NDK_ARCH }}-${{env.NDK_API }}
254+ key : avd-${{ matrix.version }}-${{ matrix.arch }}-${{ matrix.api }}
139255
140256 - name : Create AVD and generate snapshot for caching
141257 if : steps.avd-cache.outputs.cache-hit != 'true'
142258 uses : reactivecircus/android-emulator-runner@v2
143259 with :
144- api-level : ${{env.NDK_API }}
145- arch : ${{env.NDK_ARCH }}
260+ api-level : ${{ matrix.api }}
261+ arch : ${{ matrix.arch }}
146262 target : google_apis
147- ndk : ${{env.NDK_VER }}
263+ ndk : ${{ matrix.version }}
148264 force-avd-creation : false
149- emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
265+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
150266 disable-animations : false
151267 script : echo "Generated AVD snapshot for caching."
152268
153269 - name : Configure, Build and Test
154270 uses : reactivecircus/android-emulator-runner@v2
155271 with :
156- api-level : ${{env.NDK_API }}
157- arch : ${{env.NDK_ARCH }}
272+ api-level : ${{ matrix.api }}
273+ arch : ${{ matrix.arch }}
158274 target : google_apis
159- ndk : ${{env.NDK_VER }}
160- emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
275+ ndk : ${{ matrix.version }}
276+ emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
161277 disable-animations : true
162278 script : |
163279 echo "::group::Configure"
164- cmake -S . -B out -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$ANDROID_SDK_ROOT/ndk/$NDK_VER /build/cmake/android.toolchain.cmake -DANDROID_ABI:STRING=$NDK_ARCH -DANDROID_PLATFORM:STRING=19 -DANDROID_STL:STRING=c++_static
280+ cmake -S . -B out -DCMAKE_BUILD_TYPE:STRING=MinSizeRel -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$ANDROID_SDK_ROOT/ndk/${{ matrix.version }} /build/cmake/android.toolchain.cmake -DANDROID_ABI:STRING=${{ matrix.arch }} -DANDROID_PLATFORM:STRING=${{ matrix.version }} -DANDROID_STL:STRING=c++_static
165281 echo "::endgroup::"
166282 echo "::group::Build and Test"
167- cmake --build out --config $BUILD_TYPE --target run-test
283+ cmake --build out --config MinSizeRel --target run-test
168284 echo "::endgroup::"
169285
170286 emscripten :
@@ -190,12 +306,12 @@ jobs:
190306
191307 - name : Configure
192308 shell : bash
193- run : cmake -S . -B out -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
309+ run : cmake -S . -B out -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=MinSizeRel
194310
195311
196312 - name : Build and Test
197313 shell : bash
198- run : cmake --build out --config ${{env.BUILD_TYPE}} --target run-test
314+ run : cmake --build out --config MinSizeRel --target run-test
199315
200316 pythons :
201317 runs-on : ubuntu-latest
@@ -219,13 +335,13 @@ jobs:
219335 - name : Configure
220336 shell : bash
221337 run : |
222- cmake -S . -B out -DCMAKE_BUILD_TYPE=$BUILD_TYPE
338+ cmake -S . -B out -DCMAKE_BUILD_TYPE=MinSizeRel
223339
224340 - name : Build and Test
225341 shell : bash
226342 run : |
227- cmake --build out --config $BUILD_TYPE --target test-17python test-20python
343+ cmake --build out --config MinSizeRel --target test-17python test-20python
228344 echo Running test-17python
229- out/test/test-17python
345+ out/test/test-17python -ni -fc
230346 echo Running test-20python
231- out/test/test-20python
347+ out/test/test-20python -ni -fc
0 commit comments