Reducing template instaciations #32
This file contains 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' | |
- '.gitignore' | |
- '.gitattributes' | |
- 'LICENSE' | |
- 'NOTICE' | |
- '.github/workflows/publish.yml' | |
env: | |
BUILD_TYPE: Release | |
NDK_VER: 21.3.6528147 | |
NDK_ARCH: x86_64 | |
NDK_API: 29 | |
jobs: | |
desktop: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-13 | |
java: '8' | |
- os: macos-13 | |
java: '11' | |
- os: macos-13 | |
java: '17' | |
- os: macos-13 | |
java: '21' | |
- os: windows-latest | |
java: '8' | |
- os: windows-latest | |
java: '11' | |
- os: windows-latest | |
java: '17' | |
- os: windows-latest | |
java: '21' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'gcc-11|g++-11' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'gcc-12|g++-12' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'gcc-13|g++-13' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'clang-13|clang++-13' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'clang-14|clang++-14' | |
- os: ubuntu-latest | |
java: '8' | |
compiler: 'clang-15|clang++-15' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'gcc-11|g++-11' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'gcc-12|g++-12' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'gcc-13|g++-13' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'clang-13|clang++-13' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'clang-14|clang++-14' | |
- os: ubuntu-latest | |
java: '17' | |
compiler: 'clang-15|clang++-15' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'gcc-11|g++-11' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'gcc-12|g++-12' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'gcc-13|g++-13' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'clang-13|clang++-13' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'clang-14|clang++-14' | |
- os: ubuntu-latest | |
java: '21' | |
compiler: 'clang-15|clang++-15' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: System Setup | |
shell: bash | |
run: | | |
if [[ '${{ matrix.os }}' == 'ubuntu-latest' ]]; then | |
if [[ '${{ matrix.compiler}}' == 'clang-15|clang++-15' ]]; then | |
sudo apt-get update | |
sudo apt-get install -y clang-15 clang++-15 | |
fi | |
if [[ '${{ matrix.compiler }}' == 'gcc-12|g++-12' ]]; then | |
sudo apt-get update | |
sudo apt-get install -y gcc-12 g++-12 | |
fi | |
if [[ '${{ matrix.compiler }}' == 'gcc-13|g++-13' ]]; then | |
sudo apt-get update | |
sudo apt-get install -y gcc-13 g++-13 | |
fi | |
fi | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: | | |
8 | |
${{ matrix.java }} | |
distribution: 'temurin' | |
- name: Configure CMake | |
shell: bash | |
run: | | |
if [[ '${{ matrix.compiler }}' != '' ]]; then | |
IFS='|' read -ra COMPILER <<< '${{ matrix.compiler }}' | |
export CC=${COMPILER[0]} | |
export CXX=${COMPILER[1]} | |
fi | |
cmake -S . -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
- name: Build and Test Native | |
shell: bash | |
run: cmake --build build --config $BUILD_TYPE --target test-native | |
- name: Build and Test JniGen | |
shell: bash | |
run: cmake --build build --config $BUILD_TYPE --target test-jnigen | |
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: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- 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}} | |
sdcard-path-or-size: 1000M | |
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}} | |
sdcard-path-or-size: 1000M | |
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 build -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 Native" | |
cmake --build build --config $BUILD_TYPE --target test-native | |
echo "::endgroup::" | |
echo "::group::Build and Test JniGen" | |
cmake --build build --config $BUILD_TYPE --target test-jnigen | |
echo "::endgroup::" | |