From a17298480d4b5159ece7c295aafeb3bc49d080b4 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 14 Aug 2022 14:04:45 +0200 Subject: [PATCH] :alembic: try official GCC containers --- .github/workflows/ubuntu.yml | 15 +++++++++++++++ cmake/ci.cmake | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index eff653cc4..efc989357 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -90,6 +90,21 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept + ci_test_compilers_gcc: + runs-on: ubuntu-latest + strategy: + matrix: + compiler: ['7.5.0', '8.5.0'] + container: gcc:${{ matrix.compiler }} + steps: + - uses: actions/checkout@v3 + - name: Install CMake + run: sudo apt-get update ; sudo apt-get install -y cmake + - name: Run CMake + run: cmake -S . -B build -DJSON_CI=On + - name: Build + run: cmake --build build --target ci_test_compiler_default + ci_test_compilers: runs-on: ubuntu-latest container: ghcr.io/nlohmann/json-ci:v2.4.0 diff --git a/cmake/ci.cmake b/cmake/ci.cmake index 09c1c57d4..8617ca4d1 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -929,6 +929,17 @@ foreach(COMPILER g++-4.8 g++-4.9 g++-5 g++-6 g++-7 g++-8 g++-9 g++-10 g++-11 cla unset(COMPILER_TOOL CACHE) endforeach() +add_custom_target(ci_test_compiler_default + COMMAND ${CMAKE_COMMAND} + -DCMAKE_BUILD_TYPE=Debug + -DJSON_BuildTests=ON -DJSON_FastTests=ON + -S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_compiler_default + ${ADDITIONAL_FLAGS} + COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_compiler_default --parallel ${N} + COMMAND cd ${PROJECT_BINARY_DIR}/build_compiler_default && ${CMAKE_CTEST_COMMAND} --parallel ${N} --exclude-regex "test-unicode" --output-on-failure + COMMENT "Compile and test with default C++ compiler" +) + ############################################################################### # CUDA example ###############################################################################