Skip to content

chore: creating version 2.8 #122

chore: creating version 2.8

chore: creating version 2.8 #122

Workflow file for this run

name: Test
on:
push:
paths-ignore:
- 'README.md'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'doc/**'
- 'github/workflows/publish.yml'
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
hosts: ${{ steps.matrix.outputs.hosts }}
containers: ${{ steps.matrix.outputs.containers }}
steps:
- name: Define Matrix
id: matrix
shell: python
run: |
import json
import os
cxx_standards = [20, 23]
macos_map = {
'macos-14': "15.4",
'macos-15': "16.2",
'macos-26': "26.2"
}
win_paltforms = ["x64", "Win32"]
win_clang_archs = ["x64", "x86"]
gcc_map = {
11: 'ubuntu-latest',
12: 'ubuntu-latest',
13: 'ubuntu-latest',
14: 'ubuntu-24.04'
}
gcc_cont_map = {
15: 'gcc:15.1'
}
clang_map = {
13: 'ubuntu-22.04',
14: 'ubuntu-22.04',
15: 'ubuntu-22.04',
16: 'ubuntu-22.04',
17: 'ubuntu-latest',
18: 'ubuntu-latest',
19: 'ubuntu-latest',
20: 'ubuntu-latest',
21: 'ubuntu-latest'
}
hosts = []
containers=[]
#macOS
for cxx_standard in cxx_standards:
for runon, xcode in macos_map.items():
hosts.append({'os': runon, 'version': xcode, 'cxx_standard': cxx_standard, 'jobname': f'macOS - Xcode{xcode} - C++{cxx_standard}'})
#windows
for cxx_standard in cxx_standards:
for platform in win_paltforms:
hosts.append({'os': 'windows-latest', 'platform': platform, 'cxx_standard': cxx_standard, 'jobname': f'Windows - {platform} - C++{cxx_standard}'})
for arch in win_clang_archs:
hosts.append({'os': 'windows-latest', 'arch': arch, 'compiler': 'clang-cl', 'cxx_standard': cxx_standard, 'jobname': f'Windows - clang - {arch} - C++{cxx_standard}'})
#gcc hosts
for gcc, runon in gcc_map.items():
for cxx_standard in cxx_standards:
if gcc < 13 and cxx_standard == 23:
continue
hosts.append({'os': runon, 'compiler': 'gcc', 'version': gcc, 'cxx_standard': cxx_standard,
'jobname': f'Linux - GCC{gcc} - C++{cxx_standard}'})
#gcc containers
for gcc, container in gcc_cont_map.items():
for cxx_standard in cxx_standards:
if gcc < 13 and cxx_standard == 23:
continue
containers.append({'container': container, 'cxx_standard': cxx_standard,
'jobname': f'Linux - GCC{gcc} - C++{cxx_standard}'})
#clang
for clang, runon in clang_map.items():
for cxx_standard in cxx_standards:
if clang < 18 and cxx_standard == 23:
continue
hosts.append({'os': runon, 'compiler': 'clang', 'version': clang, 'cxx_standard': cxx_standard,
'jobname': f'Linux - Clang{clang} - C++{cxx_standard}'})
with open(os.environ['GITHUB_OUTPUT'], 'w') as env:
print('hosts=' + json.dumps(hosts), file=env)
print('containers=' + json.dumps(containers), file=env)
desktop:
needs: define-matrix
name: ${{ matrix.jobname }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.define-matrix.outputs.hosts) }}
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
fi
if [[ '${{ matrix.os }}' == macos-* ]]; then
echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.version }}.app" >> $GITHUB_ENV
fi
if [[ '${{ matrix.os }}' == windows-* ]]; then
if [[ '${{ matrix.compiler }}' != '' ]]; then
if [[ '${{ matrix.arch }}' == "x64" ]]; then
VCPREFIX="C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\Llvm\\x64\\bin"
else
VCPREFIX="C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\Llvm\\bin"
fi
echo "CC=$VCPREFIX\\${{ matrix.compiler }}" >> $GITHUB_ENV
echo "CXX=$VCPREFIX\\${{ matrix.compiler }}" >> $GITHUB_ENV
echo "CMAKE_GENERATOR=-GNinja" >> $GITHUB_ENV
fi
fi
CMAKE_ARGS=(-DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DCMAKE_CXX_STANDARD_REQUIRED=ON)
if [[ '${{ matrix.platform }}' != "" ]]; then
CMAKE_ARGS+=(-DCMAKE_GENERATOR_PLATFORM=${{ matrix.platform }})
fi
if [[ ${#CMAKE_ARGS[@]} != 0 ]]; then
echo "CMAKE_ARGS=${CMAKE_ARGS[@]}" >> $GITHUB_ENV
fi
- name: Configure
shell: bash
run: |
cmake $CMAKE_GENERATOR -S . -B out $CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
- name: Build and Test
shell: bash
run: cmake --build out --config Release --target run-test samples
container:
needs: define-matrix
name: ${{ matrix.jobname }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.define-matrix.outputs.containers) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: System Setup
shell: bash
run: |
apt-get update
apt-get install -y ninja-build cmake locales
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen
locale-gen
- name: Configure
shell: bash
run: |
export EXTRA_FLAGS="-DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DCMAKE_CXX_STANDARD_REQUIRED=ON"
cmake -S . -B out $EXTRA_FLAGS -DCMAKE_BUILD_TYPE=Release
- name: Build and Test
shell: bash
run: |
cmake --build out --config Release --target run-test samples
android:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [25.2.9519653]
api: [29, 30]
arch: [x86_64]
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-${{ matrix.version }}-${{ matrix.arch }}-${{ matrix.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: ${{ matrix.api }}
arch: ${{matrix.arch}}
target: google_apis
ndk: ${{ matrix.version }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Configure, Build and Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api }}
arch: ${{matrix.arch}}
target: google_apis
ndk: ${{ matrix.version }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
disable-animations: true
script: |
echo "::group::Configure"
cmake -S . -B out -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$ANDROID_SDK_ROOT/ndk/${{ matrix.version }}/build/cmake/android.toolchain.cmake -DANDROID_ABI:STRING=${{ matrix.arch }} -DANDROID_PLATFORM:STRING=${{ matrix.api }} -DANDROID_STL:STRING=c++_static
echo "::endgroup::"
echo "::group::Build and Test"
cmake --build out --config Release --target run-test samples
echo "::endgroup::"