init build workflow #16
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 | |
env: | |
IMAGE_PREFIX: "ghcr.io/dnkpp/" | |
on: | |
push: | |
branches: [master, dev] | |
pull_request: | |
branches: [master, dev] | |
jobs: | |
build: | |
name: | | |
${{ matrix.config.prefix }} | |
${{ matrix.config.compiler_name }}-${{ matrix.config.compiler_version }} | |
${{ matrix.config.suffix }} | |
(C++${{ matrix.cxx_standard }} ${{ matrix.build_mode }}) | |
runs-on: ${{ matrix.config.os }} | |
container: | |
image: ghcr.io/dnkpp/${{ matrix.config.compiler_name }}:${{ matrix.config.compiler_version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build_mode: [Debug, Release] | |
cxx_standard: [20, 23] | |
config: | |
#clang-18 | |
- { | |
prefix: "Linux", | |
suffix: "/libc++", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 18, | |
libcxx: true | |
} | |
- { | |
prefix: "Linux", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 18, | |
libcxx: false | |
} | |
#clang-17 | |
- { | |
prefix: "Linux", | |
suffix: "/libc++", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 17, | |
libcxx: true | |
} | |
- { | |
prefix: "Linux", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 17, | |
libcxx: false | |
} | |
#clang-16 | |
- { | |
prefix: "Linux", | |
suffix: "/libc++", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 16, | |
libcxx: true | |
} | |
- { | |
prefix: "Linux", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 16, | |
libcxx: false | |
} | |
#clang-15 | |
- { | |
prefix: "Linux", | |
suffix: "/libc++", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 15, | |
libcxx: true | |
} | |
- { | |
prefix: "Linux", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 15, | |
libcxx: false | |
} | |
#clang-14 | |
- { | |
prefix: "Linux", | |
suffix: "/libc++", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 14, | |
libcxx: true | |
} | |
- { | |
prefix: "Linux", | |
os: ubuntu-latest, | |
compiler_name: "clang", | |
compiler_version: 14, | |
libcxx: false | |
} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libc++ | |
if: ${{ matrix.config.compiler_name == 'clang' && matrix.config.libcxx == true }} | |
run: | | |
apt-get update | |
apt-get install -y \ | |
libc++-${{ matrix.config.compiler_version }}-dev \ | |
libc++abi-${{ matrix.config.compiler_version }}-dev | |
echo "CXX_FLAGS=$(echo CXX_FLAGS -stdlib=libc++)" >> $GITHUB_ENV | |
echo "LINK_FLAGS=$(echo LINK_FLAGS -lc++ab)" >> $GITHUB_ENV | |
- name: Configure | |
run: | | |
cmake \ | |
-D CMAKE_BUILD_TYPE=${{ matrix.build_mode }} \ | |
-D CMAKE_VERBOSE_MAKEFILE=yes \ | |
-D mimicpp_BUILD_TESTS=yes \ | |
-D mimicpp_FORCED_CXX_STANDARD:STRING="${{ matrix.cxx_standard }}" \ | |
-D CMAKE_CXX_FLAGS:STRING="${{ env.CXX_FLAGS }}" \ | |
-D CMAKE_EXE_LINKER_FLAGS:STRING="${{ env.LINK_FLAGS }}" \ | |
-B build -S . | |
- name: Build | |
run: | | |
cmake --build build -j4 | |
- name: Run tests | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
run: ctest --test-dir build/test -C ${{ matrix.build_mode }} -j4 |