Skip to content

Add android build test #27

Add android build test

Add android build test #27

name: CMake on multiple platforms
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
windows:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.head_ref || github.ref_name }}-${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build_type }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=cl
-DCMAKE_C_COMPILER=cl
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPREVIEW_TEST=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}
ubuntu-gcc:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.head_ref || github.ref_name }}-${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.compiler }}-${{ matrix.compiler_version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler: [gcc]
compiler_version: [9, 10, 11]
include:
- cc_compiler: gcc
- cxx_compiler: g++
steps:
- uses: actions/checkout@v4
- name: Configure CMake
env:
CC: ${{ matrix.cc_compiler }}-${{ matrix.compiler_version }}
CXX: ${{ matrix.cxx_compiler }}-${{ matrix.compiler_version }}
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
-DCMAKE_C_COMPILER=${{ env.CC }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPREVIEW_TEST=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}
ubuntu-clang:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.head_ref || github.ref_name }}-${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.compiler }}-${{ matrix.compiler_version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler: [clang]
compiler_version: [13, 14, 15]
include:
- cc_compiler: clang
- cxx_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Configure CMake
env:
CC: ${{ matrix.cc_compiler }}-${{ matrix.compiler_version }}
CXX: ${{ matrix.cxx_compiler }}-${{ matrix.compiler_version }}
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
-DCMAKE_C_COMPILER=${{ env.CC }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPREVIEW_TEST=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}
ubuntu-android-ndk:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.head_ref || github.ref_name }}-${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.compiler }}-${{ matrix.compiler_version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler: [ndk]
compiler_version: [18, 19, 20, 21, 22, 23, 24, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r${{ matrix.compiler_version }}
add-to-path: false
- run: |
echo $ANDROID_HOME
echo ${{ steps.setup-ndk.outputs.ndk-path }}
- run: |
tree $ANDROID_HOME/ndk
# - name: Configure CMake
# env:
# CC: ${{ matrix.cc_compiler }}-${{ matrix.compiler_version }}
# CXX: ${{ matrix.cxx_compiler }}-${{ matrix.compiler_version }}
# run: >
# cmake -B build
# -DCMAKE_CXX_COMPILER=${{ env.CXX }}
# -DCMAKE_C_COMPILER=${{ env.CC }}
# -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
# -DPREVIEW_TEST=ON
# -S ${{ github.workspace }}
#
# - name: Build
# run: cmake --build build --config ${{ matrix.build_type }}
#
# - name: Test
# working-directory: build
# run: ctest --build-config ${{ matrix.build_type }}
macos-appleclang:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.head_ref || github.ref_name }}-${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.compiler }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-latest]
build_type: [Debug, Release]
compiler: [clang]
include:
- cc_compiler: clang
- cxx_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Configure CMake
env:
CC: ${{ matrix.cc_compiler }}
CXX: ${{ matrix.cxx_compiler }}
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
-DCMAKE_C_COMPILER=${{ env.CC }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPREVIEW_TEST=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}