update readme #633
Workflow file for this run
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: CMake Build and Test CI | |
# Build and Test CI for platforms ({{ windows, linux and macos }} - latest) | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
# <Linux, Release, latest GCC compiler toolchain on the default runner image, ninja generator> | |
- name: "ubuntu latest gcc rel ninja" | |
os: ubuntu-latest | |
build_type: Release | |
cc: gcc | |
cxx: g++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_ENABLE_INSTALL=1' | |
# <Linux, Release, latest Clang compiler toolchain on the default runner image, ninja generator> | |
- name: "ubuntu latest clang rel ninja" | |
os: ubuntu-latest | |
build_type: Release | |
cc: clang | |
cxx: clang++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_ENABLE_INSTALL=1' | |
# <macOS latest ARM64, Release, latest Clang compiler toolchain on the default runner image, ninja generator> | |
- name: "macOS latest ARM64 clang rel ninja" | |
os: macos-latest | |
build_type: Release | |
cc: clang | |
cxx: clang++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_ENABLE_INSTALL=1' | |
# <macOS-13, Release, latest Clang compiler toolchain on the default runner image, ninja generator> | |
- name: "macOS-13 clang rel ninja" | |
os: macos-13 | |
build_type: Release | |
cc: clang | |
cxx: clang++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_ENABLE_INSTALL=1' | |
# <Windows, Release, latest Cl compiler toolchain on the default runner image, Visual Studio 17 2022 generator> | |
- name: "windows latest cl rel visual studio 17 2022 with deps" | |
os: windows-latest | |
build_type: Release | |
cc: cl | |
cxx: cl | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_BUILD_DEPS=1' | |
# <Linux, Release, latest GCC compiler toolchain on the default runner image, ninja generator> | |
- name: "ubuntu latest gcc rel ninja with deps" | |
os: ubuntu-latest | |
build_type: Release | |
cc: gcc | |
cxx: g++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_BUILD_DEPS=1' | |
# <macOS latest ARM64, Release, latest Clang compiler toolchain on the default runner image, ninja generator> | |
- name: "macOS latest ARM64 clang rel ninja with deps" | |
os: macos-latest | |
build_type: Release | |
cc: clang | |
cxx: clang++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_BUILD_DEPS=1' | |
# <Linux, Release, latest GCC compiler toolchain on the default runner image, ninja generator> | |
- name: "ubuntu latest clang rel ninja with deps sanitize address" | |
os: ubuntu-latest | |
build_type: Release | |
cc: clang | |
cxx: clang++ | |
cmake-opts: '-DUHDR_BUILD_TESTS=1 -DUHDR_ENABLE_LOGS=1 -DUHDR_BUILD_DEPS=1 -DUHDR_SANITIZE_OPTIONS=address' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies on Ubuntu | |
if: startsWith(matrix.config.os, 'ubuntu') | |
run: sudo apt install -y libjpeg-dev ninja-build | |
- name: Install dependencies on macOS | |
if: startsWith(matrix.config.os, 'macos') | |
run: brew install pkg-config jpeg ninja | |
- name: Configure CMake | |
shell: bash | |
run: | | |
export CC=${{ matrix.config.cc }} | |
export CXX=${{ matrix.config.cxx }} | |
mkdir build | |
if [[ "${{ matrix.config.os }}" == "windows-latest" ]]; then | |
cmake -G "Visual Studio 17 2022" -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ${{ matrix.config.cmake-opts }} | |
else | |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ${{ matrix.config.cmake-opts }} | |
fi | |
- name: Build | |
#Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: cmake --build build --config ${{ matrix.config.build_type }} | |
- name: Test | |
working-directory: build | |
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: ctest --build-config ${{ matrix.config.build_type }} |