From 4a56f12cf41a19e1ed665eb08c2c9341fb7e3d91 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 17 Jan 2021 14:37:38 +0100 Subject: [PATCH] :construction_worker: use GitHub Actions --- .github/workflows/ubuntu.yml | 40 ++++++++++++++++++++++++++++++++++-- cmake/ci.cmake | 20 +++++++++--------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d6b654077..7f932063a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v1 - - name: install_gcc + - name: install_clang run: | sudo apt update sudo apt install clang-10 @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@v1 - - name: install_gcc + - name: install_clang run: | sudo apt update sudo apt install clang-10 @@ -62,3 +62,39 @@ jobs: run: cmake --build build --parallel 10 - name: test run: cd build ; ctest -j 10 --output-on-failure + + ci_test_gcc: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: install_gcc + run: | + sudo apt update + sudo apt install gcc-10 g++-10 + shell: bash + - name: cmake + run: cmake -S . -B build -DJSON_CI=On + env: + CC: gcc-10 + CXX: g++-10 + - name: build + run: cmake --build build --target ci_test_gcc --parallel 10 + + ci_test_clang: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: install_clang + run: | + sudo apt update + sudo apt install clang-10 + shell: bash + - name: cmake + run: cmake -S . -B build -DJSON_CI=On + env: + CC: clang-10 + CXX: clang++-10 + - name: build + run: cmake --build build --target ci_test_clang --parallel 10 diff --git a/cmake/ci.cmake b/cmake/ci.cmake index 9cec0ed94..0c05964b7 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -12,40 +12,40 @@ include(FindPython3) find_package(Python3 COMPONENTS Interpreter) -find_program(CLANG_TIDY_TOOL NAMES clang-tidy REQUIRED) +find_program(CLANG_TIDY_TOOL NAMES clang-tidy) execute_process(COMMAND ${CLANG_TIDY_TOOL} --version OUTPUT_VARIABLE CLANG_TIDY_TOOL_VERSION ERROR_VARIABLE CLANG_TIDY_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TIDY_TOOL_VERSION "${CLANG_TIDY_TOOL_VERSION}") message(STATUS "🔖 Clang-Tidy ${CLANG_TIDY_TOOL_VERSION} (${CLANG_TIDY_TOOL})") -find_program(CLANG_TOOL NAMES clang++-HEAD clang++-11 clang++ REQUIRED) +find_program(CLANG_TOOL NAMES clang++-HEAD clang++-11 clang++) execute_process(COMMAND ${CLANG_TOOL} --version OUTPUT_VARIABLE CLANG_TOOL_VERSION ERROR_VARIABLE CLANG_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TOOL_VERSION "${CLANG_TOOL_VERSION}") message(STATUS "🔖 Clang ${CLANG_TOOL_VERSION} (${CLANG_TOOL})") -find_program(CPPCHECK_TOOL NAMES cppcheck REQUIRED) +find_program(CPPCHECK_TOOL NAMES cppcheck) execute_process(COMMAND ${CPPCHECK_TOOL} --version OUTPUT_VARIABLE CPPCHECK_TOOL_VERSION ERROR_VARIABLE CPPCHECK_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CPPCHECK_TOOL_VERSION "${CPPCHECK_TOOL_VERSION}") message(STATUS "🔖 Cppcheck ${CPPCHECK_TOOL_VERSION} (${CPPCHECK_TOOL})") -find_program(GCC_TOOL NAMES g++-HEAD g++-11 g++ REQUIRED) +find_program(GCC_TOOL NAMES g++-HEAD g++-11 g++) execute_process(COMMAND ${GCC_TOOL} --version OUTPUT_VARIABLE GCC_TOOL_VERSION ERROR_VARIABLE GCC_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" GCC_TOOL_VERSION "${GCC_TOOL_VERSION}") message(STATUS "🔖 GCC ${GCC_TOOL_VERSION} (${GCC_TOOL})") -find_program(INFER_TOOL NAMES infer REQUIRED) +find_program(INFER_TOOL NAMES infer) execute_process(COMMAND ${INFER_TOOL} --version OUTPUT_VARIABLE INFER_TOOL_VERSION ERROR_VARIABLE INFER_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" INFER_TOOL_VERSION "${INFER_TOOL_VERSION}") message(STATUS "🔖 Infer ${INFER_TOOL_VERSION} (${INFER_TOOL})") -find_program(IWYU_TOOL NAMES include-what-you-use iwyu REQUIRED) +find_program(IWYU_TOOL NAMES include-what-you-use iwyu) execute_process(COMMAND ${IWYU_TOOL} --version OUTPUT_VARIABLE IWYU_TOOL_VERSION ERROR_VARIABLE IWYU_TOOL_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" IWYU_TOOL_VERSION "${IWYU_TOOL_VERSION}") message(STATUS "🔖 include-what-you-use ${IWYU_TOOL_VERSION} (${IWYU_TOOL})") -find_program(OCLINT_TOOL NAMES oclint-json-compilation-database REQUIRED) -find_program(PLOG_CONVERTER_TOOL NAMES plog-converter REQUIRED) -find_program(PVS_STUDIO_ANALYZER_TOOL NAMES pvs-studio-analyzer REQUIRED) -find_program(SCAN_BUILD_TOOL NAMES scan-build REQUIRED) +find_program(OCLINT_TOOL NAMES oclint-json-compilation-database) +find_program(PLOG_CONVERTER_TOOL NAMES plog-converter) +find_program(PVS_STUDIO_ANALYZER_TOOL NAMES pvs-studio-analyzer) +find_program(SCAN_BUILD_TOOL NAMES scan-build) # the individual source files file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/include/nlohmann/*.hpp)