Adding more python checks to CI #240
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- '*' | |
- '*/**' | |
paths-ignore: | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'doc/**' | |
- 'tools/**' | |
env: | |
BUILD_TYPE: MinSizeRel | |
NDK_VER: 27.2.12479018 | |
NDK_ARCH: x86_64 | |
NDK_API: 29 | |
jobs: | |
desktop: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {os: macos-15, version: 16 } | |
- {os: macos-14, version: "15.4" } | |
- os: windows-latest | |
- {os: ubuntu-latest, compiler: gcc, version: 12 } | |
- {os: ubuntu-latest, compiler: gcc, version: 13 } | |
- {os: ubuntu-24.04, compiler: gcc, version: 14 } | |
#- {os: ubuntu-24.04, compiler: gcc, version: 15 } | |
- {os: ubuntu-22.04, compiler: clang, version: 16 } | |
- {os: ubuntu-latest, compiler: clang, version: 17 } | |
- {os: ubuntu-latest, compiler: clang, version: 18 } | |
- {os: ubuntu-latest, compiler: clang, version: 19 } | |
- {os: ubuntu-latest, compiler: clang, version: 20 } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: System Setup | |
shell: bash | |
run: | | |
if [[ '${{ matrix.os }}' == ubuntu-* ]]; then | |
if [[ '${{ matrix.compiler }}' == 'clang' ]]; then | |
wget https://apt.llvm.org/llvm.sh | |
chmod u+x llvm.sh | |
sudo ./llvm.sh ${{ matrix.version }} | |
sudo apt-get install -y clang-tools-${{ matrix.version }} libc++-${{ matrix.version }}-dev libc++abi-${{ matrix.version }}-dev | |
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV | |
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV | |
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV | |
fi | |
if [[ '${{ matrix.compiler }}' == 'gcc' ]]; then | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y gcc-${{ matrix.version }} g++-${{ matrix.version }} | |
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV | |
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV | |
fi | |
# wget https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz | |
# tar -xzf icu4c-76_1-src.tgz | |
# cd icu/source | |
# ./configure --prefix $GITHUB_WORKSPACE/icu_root \ | |
# --enable-static=no \ | |
# --enable-shared=yes \ | |
# --enable-extras=no \ | |
# --enable-icuio=no \ | |
# --enable-tests=no \ | |
# --enable-samples=no \ | |
# --enable-tools=yes \ | |
# --with-data-packaging=library | |
# make -j `nproc` | |
# make install | |
# echo "ICU_ROOT=$GITHUB_WORKSPACE/icu_root" >> $GITHUB_ENV | |
# echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/icu_root/lib" >> $GITHUB_ENV | |
fi | |
if [[ '${{ matrix.os }}' == macos-* ]]; then | |
brew install icu4c | |
echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.version }}.app" >> $GITHUB_ENV | |
echo "ICU_ROOT=$(brew --cellar icu4c)/$(brew info --json icu4c | jq -r '.[0].installed[0].version')" >> $GITHUB_ENV | |
fi | |
- name: Configure | |
shell: bash | |
run: | | |
cmake -S . -B out -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
- name: Build and Test | |
shell: bash | |
run: cmake --build out --config $BUILD_TYPE --target run-test | |
container: | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
container: [gcc:15.1] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pre-requisites | |
run: | | |
apt-get update | |
apt-get install -y ninja-build cmake | |
apt-get install -y python3-dev | |
- name: Configure | |
shell: bash | |
run: | | |
cmake -S . -B out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build and Test | |
shell: bash | |
run: cmake --build out --config ${{env.BUILD_TYPE}} --target run-test | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{env.NDK_VER}}-${{env.NDK_ARCH}}-${{env.NDK_API}} | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{env.NDK_API}} | |
arch: ${{env.NDK_ARCH}} | |
target: google_apis | |
ndk: ${{env.NDK_VER}} | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Configure, Build and Test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{env.NDK_API}} | |
arch: ${{env.NDK_ARCH}} | |
target: google_apis | |
ndk: ${{env.NDK_VER}} | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
echo "::group::Configure" | |
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 | |
echo "::endgroup::" | |
echo "::group::Build and Test" | |
cmake --build out --config $BUILD_TYPE --target run-test | |
echo "::endgroup::" | |
emscripten: | |
runs-on: ubuntu-latest | |
container: emscripten/emsdk:3.1.70 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pre-requisites | |
run: | | |
apt-get update | |
apt-get install -y ninja-build | |
apt-get install -y python3-dev | |
export CMAKE_VERSION=3.27.1 | |
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \ | |
-q -O /tmp/cmake-install.sh \ | |
&& chmod u+x /tmp/cmake-install.sh \ | |
&& /tmp/cmake-install.sh --skip-license --prefix=/usr \ | |
rm -f /tmp/cmake-install.sh | |
- name: Configure | |
shell: bash | |
run: cmake -S . -B out -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build and Test | |
shell: bash | |
run: cmake --build out --config ${{env.BUILD_TYPE}} --target run-test | |
pythons: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ | |
"3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", | |
"pypy-3.9", "pypy-3.10", "pypy-3.11" | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Configure | |
shell: bash | |
run: | | |
cmake -S . -B out -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
- name: Build and Test | |
shell: bash | |
run: cmake --build out --config $BUILD_TYPE --target run-test |