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: build & test | ||
on: | ||
push: | ||
branches: [ main, development ] | ||
pull_request: | ||
branches: [ main, development ] | ||
jobs: | ||
############ | ||
# | ||
# Defines the compiler configurations for the other jobs. | ||
# | ||
##### | ||
generate-base-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
config: ${{ steps.output-config.outputs.config }} | ||
build_modes: ${{ steps.output-options.outputs.build_modes }} | ||
cxx_versions: ${{ steps.output-options.outputs.cxx_versions }} | ||
steps: | ||
# enables debug-mode and c++20 for all cases | ||
- name: Enable base matrix | ||
shell: bash | ||
run: | | ||
echo "BUILD_MODES=\"Debug\"" >> $GITHUB_ENV | ||
echo "CXX_VERSIONS=20" >> $GITHUB_ENV | ||
# if its a PR from development or the main branch in general, add release-mode and c++23 | ||
- name: Enable extended matrix | ||
if: ${{ | ||
(github.event_name == 'pull_request' && github.head_ref == 'development') | ||
|| github.ref_name == 'main' | ||
}} | ||
shell: bash | ||
run: | | ||
echo "BUILD_MODES=$(echo $BUILD_MODES, \"Release\")" >> $GITHUB_ENV | ||
echo "CXX_VERSIONS=$(echo $CXX_VERSIONS, 23)" >> $GITHUB_ENV | ||
- name: Output build-modes and c++-versions | ||
id: output-options | ||
shell: bash | ||
run: | | ||
echo "build_modes=$(echo [ $BUILD_MODES ])" >> "$GITHUB_OUTPUT" | ||
echo "cxx_versions=$(echo [ $CXX_VERSIONS ])" >> "$GITHUB_OUTPUT" | ||
build-and-test: | ||
needs: define-matrix | ||
runs-on: generate-base-matrix | ||
fail-fast: false | ||
strategy: | ||
build_mode: ${{ fromJSON(needs.define-matrix.outputs.build_modes) }} | ||
cxx_standard: ${{ fromJSON(needs.define-matrix.outputs.cxx_versions) }} | ||
config: | ||
- prefix: "Linux" | ||
suffix: "/libc++" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:18" | ||
compiler_name: "clang" | ||
compiler_version: 18 | ||
architecture: "x64" | ||
libcxx: true | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:18" | ||
compiler_name: "clang" | ||
compiler_version: 18 | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
suffix: "/libc++" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:17" | ||
compiler_name: "clang" | ||
compiler_version: 17 | ||
architecture: "x64" | ||
libcxx: true | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:17" | ||
compiler_name: "clang" | ||
compiler_version: 17 | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
suffix: "/libc++" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:16" | ||
compiler_name: "clang" | ||
compiler_version: 16 | ||
only_fmt: true | ||
architecture: "x64" | ||
libcxx: true | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/clang:16" | ||
compiler_name: "clang" | ||
compiler_version: 16 | ||
only_fmt: true | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/gcc:14" | ||
compiler_name: "gcc" | ||
compiler_version: 14 | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/gcc:14" | ||
compiler_name: "gcc" | ||
compiler_version: 14 | ||
architecture: "32bit" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/gcc:13" | ||
compiler_name: "gcc" | ||
compiler_version: 13 | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
- prefix: "Linux" | ||
os: "ubuntu-latest" | ||
container: | ||
image: "ghcr.io/dnkpp/gcc:12" | ||
compiler_name: "gcc" | ||
compiler_version: 12 | ||
only_fmt: true | ||
architecture: "x64" | ||
libcxx: false | ||
asan: true | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Clang libc++ setup | ||
if: ${{ matrix.config.compiler_name == 'clang' && matrix.config.libcxx == true }} | ||
shell: bash | ||
run: | | ||
echo "CXXFLAGS=$(echo ${CXXFLAGS} -stdlib=libc++)" >> $GITHUB_ENV | ||
echo "LDFLAGS=$(echo ${LDFLAGS} -lc++abi)" >> $GITHUB_ENV | ||
# ASan has some serious trouble with libc++ exception mechanism | ||
# see: https://github.com/llvm/llvm-project/issues/59432 | ||
- name: Disable alloc_dealloc_mismatch detection with libc++ | ||
if: ${{ matrix.config.asan == true && matrix.config.libcxx == true}} | ||
shell: bash | ||
run: | | ||
echo "ASAN_OPTIONS=$(echo ${ASAN_OPTIONS}:alloc_dealloc_mismatch=0)" >> $GITHUB_ENV | ||
################################# | ||
# | ||
- name: Configure Basic Framework | ||
id: config-basic | ||
if: ${{ matrix.config.only_fmt != true }} | ||
shell: bash | ||
run: | | ||
cmake \ | ||
-S . \ | ||
-B build \ | ||
--log-level=DEBUG \ | ||
-D CMAKE_VERBOSE_MAKEFILE=YES \ | ||
-D CMAKE_BUILD_TYPE="${{ matrix.build_mode }}" \ | ||
-D MIMICPP_FORCED_CXX_STANDARD="${{ matrix.cxx_standard }}" | ||
- name: Build Basic Framework | ||
if: ${{ steps.config-basic.outcome == 'success' }} | ||
shell: bash | ||
run: | | ||
cmake --build build -j5 | ||
- name: Run Basic Framework tests | ||
if: ${{ steps.config-basic.outcome == 'success' }} | ||
shell: bash | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: 1 | ||
run: | | ||
ctest --test-dir build \ | ||
-C ${{ matrix.build_mode }} \ | ||
-j5 | ||
# | ||
################################# |