Feat/context #117
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
##================================================================================================== | |
## KIWAKU - Containers Well Made | |
## Copyright : KIWAKU Contributors & Maintainers | |
## SPDX-License-Identifier: BSL-1.0 | |
##================================================================================================== | |
name: Kiwaku - Unit Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: unit-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
gcc-linux: | |
runs-on: [ubuntu-latest] | |
container: | |
image: ghcr.io/jfalcou/compilers:v7 | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- { opts: -O0 } | |
- { opts: -Ofast -flto=auto -DNDEBUG } | |
steps: | |
- name: Fetch current branch | |
uses: actions/checkout@v4 | |
- name: Setup Kiwaku using g++-12 with ${{ matrix.cfg.opts }} | |
run: | | |
mkdir build | |
cd build | |
cmake .. -G Ninja -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" | |
- name: Compile Unit Tests | |
run: cd build && ninja -j 2 | |
- name: Run Unit Tests | |
run: cd build && ctest -j 2 | |
clang-linux: | |
runs-on: [ubuntu-latest] | |
container: | |
image: ghcr.io/jfalcou/compilers:v7 | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- { opts: -O0 , linker: } | |
- { opts: "-Ofast -flto -DNDEBUG" , linker: } | |
- { opts: "-Ofast -flto -DNDEBUG -stdlib=libc++", linker: -stdlib=libc++ } | |
- { opts: "-O0 -stdlib=libc++" , linker: -stdlib=libc++ } | |
steps: | |
- name: Fetch current branch | |
uses: actions/checkout@v4 | |
- name: Running CMake for clang++ with ${{ matrix.cfg.opts }} | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.cfg.linker }}" | |
- name: Compiling Unit Tests | |
run: cd build && make unit -j 2 | |
- name: Running Unit Tests | |
run: cd build && ctest --output-on-failure -j 2 | |
clang-macosx: | |
runs-on: [macos-14] | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- { opts: -O0 , linker: } | |
- { opts: "-O0 -stdlib=libc++" , linker: -stdlib=libc++ } | |
- { opts: "-Ofast -flto -DNDEBUG" , linker: } | |
- { opts: "-Ofast -flto -DNDEBUG -stdlib=libc++", linker: -stdlib=libc++ } | |
steps: | |
- name: Fetch current branch | |
uses: actions/checkout@v4 | |
- name: Running CMake for clang++ with ${{ matrix.cfg.opts }} | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.cfg.linker }}" | |
- name: Compiling Unit Tests | |
run: cd build && make unit -j 2 | |
- name: Running Unit Tests | |
run: cd build && ctest --output-on-failure -j 2 | |
gcc-macosx: | |
runs-on: [macos-14] | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- { opts: -O0 } | |
- { opts: -Ofast -flto -DNDEBUG } | |
steps: | |
- name: Fetch current branch | |
uses: actions/checkout@v4 | |
- name: Running CMake for g++ with ${{ matrix.cfg.opts }} | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" | |
- name: Compiling Unit Tests | |
run: cd build && make unit -j 2 | |
- name: Running Unit Tests | |
run: cd build && ctest --output-on-failure -j 2 | |
android: | |
runs-on: [macos-14] | |
strategy: | |
fail-fast: false | |
matrix: | |
cfg: | |
- { opts: -O0 } | |
- { opts: -Ofast -flto -DNDEBUG } | |
steps: | |
- name: Fetch current branch | |
uses: actions/checkout@v4 | |
- name: Running CMake for g++ with ${{ matrix.cfg.opts }} | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" -DANDROID_ABI=arm64-v8a | |
- name: Compiling Unit Tests | |
run: cd build && make unit -j 2 | |
# msvc: | |
# runs-on: [windows-2022] | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# cfg: | |
# - { mode: Debug } | |
# - { mode: Release} | |
# steps: | |
# - name: Fetch current branch | |
# uses: actions/checkout@v4 | |
# - name: Running CMake for MSVC ${{ matrix.cfg.mode }} | |
# run: | | |
# mkdir build && cd build | |
# cmake -G "Visual Studio 17 2022" -A x64 .. -DKIWAKU_BUILD_TEST=ON | |
# - name: Compiling Unit Tests | |
# run: | | |
# cd build | |
# cmake --build . --target unit --config ${{ matrix.cfg.mode }} --parallel 2 | |
# - name: Running Tests | |
# run: | | |
# cd build | |
# ctest -C ${{ matrix.cfg.mode }} --output-on-failure |