diff --git a/scripts/ci/cmake-v2/ci-common.cmake b/scripts/ci/cmake-v2/ci-common.cmake index dc03b2febc..033692ad98 100644 --- a/scripts/ci/cmake-v2/ci-common.cmake +++ b/scripts/ci/cmake-v2/ci-common.cmake @@ -15,7 +15,7 @@ if(NOT CTEST_BUILD_FLAGS) if(CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles") set(CTEST_BUILD_FLAGS "-k -j${N2CPUS}") elseif(CTEST_CMAKE_GENERATOR STREQUAL "Ninja") - set(CTEST_BUILD_FLAGS "-k0 -j${N2CPUS}") + set(CTEST_BUILD_FLAGS "-j${N2CPUS}") endif() endif() if(NOT PARALLEL_LEVEL IN_LIST CTEST_TEST_ARGS) diff --git a/scripts/ci/cmake-v2/ci-el8-cuda-serial.cmake b/scripts/ci/cmake-v2/ci-el8-cuda-serial.cmake index 275829f124..eca07809fe 100644 --- a/scripts/ci/cmake-v2/ci-el8-cuda-serial.cmake +++ b/scripts/ci/cmake-v2/ci-el8-cuda-serial.cmake @@ -1,9 +1,5 @@ # Client maintainer: vicente.bolea@kitware.com -include(ProcessorCount) -ProcessorCount(NCPUS) -math(EXPR N2CPUS "${NCPUS}*2") - set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) @@ -25,7 +21,6 @@ CMAKE_CXX_FLAGS:STRING=-Wall CMAKE_Fortran_FLAGS:STRING=-Wall ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL ${NCPUS}) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc10-mpi.cmake b/scripts/ci/cmake-v2/ci-el8-gcc10-mpi.cmake index 4bc8c1b644..37965ff7c3 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc10-mpi.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc10-mpi.cmake @@ -28,7 +28,6 @@ MPIEXEC_EXTRA_FLAGS:STRING=--allow-run-as-root --oversubscribe MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS} ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc10-mpich.cmake b/scripts/ci/cmake-v2/ci-el8-gcc10-mpich.cmake index b0c5fc870f..5ce2313669 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc10-mpich.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc10-mpich.cmake @@ -27,7 +27,6 @@ CMAKE_Fortran_FLAGS:STRING=-Wall MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS} ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc10-serial.cmake b/scripts/ci/cmake-v2/ci-el8-gcc10-serial.cmake index 78b7ef0698..b25289765d 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc10-serial.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc10-serial.cmake @@ -21,7 +21,6 @@ CMAKE_CXX_FLAGS:STRING=-Wall CMAKE_Fortran_FLAGS:STRING=-Wall ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc11-mpi.cmake b/scripts/ci/cmake-v2/ci-el8-gcc11-mpi.cmake index 4bc8c1b644..37965ff7c3 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc11-mpi.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc11-mpi.cmake @@ -28,7 +28,6 @@ MPIEXEC_EXTRA_FLAGS:STRING=--allow-run-as-root --oversubscribe MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS} ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc11-serial.cmake b/scripts/ci/cmake-v2/ci-el8-gcc11-serial.cmake index 78b7ef0698..b25289765d 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc11-serial.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc11-serial.cmake @@ -21,7 +21,6 @@ CMAKE_CXX_FLAGS:STRING=-Wall CMAKE_Fortran_FLAGS:STRING=-Wall ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc9-mpi.cmake b/scripts/ci/cmake-v2/ci-el8-gcc9-mpi.cmake index 4bc8c1b644..37965ff7c3 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc9-mpi.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc9-mpi.cmake @@ -28,7 +28,6 @@ MPIEXEC_EXTRA_FLAGS:STRING=--allow-run-as-root --oversubscribe MPIEXEC_MAX_NUMPROCS:STRING=${N2CPUS} ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/cmake-v2/ci-el8-gcc9-serial.cmake b/scripts/ci/cmake-v2/ci-el8-gcc9-serial.cmake index 78b7ef0698..b25289765d 100644 --- a/scripts/ci/cmake-v2/ci-el8-gcc9-serial.cmake +++ b/scripts/ci/cmake-v2/ci-el8-gcc9-serial.cmake @@ -21,7 +21,6 @@ CMAKE_CXX_FLAGS:STRING=-Wall CMAKE_Fortran_FLAGS:STRING=-Wall ") -set(CTEST_TEST_ARGS PARALLEL_LEVEL 1) -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CMAKE_GENERATOR "Ninja") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake) diff --git a/scripts/ci/gh-actions/config/ninja.cmake b/scripts/ci/gh-actions/config/ninja.cmake new file mode 100644 index 0000000000..6f20c4cd86 --- /dev/null +++ b/scripts/ci/gh-actions/config/ninja.cmake @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) + +set(version 1.11.0) + +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(sha256sum 9726e730d5b8599f82654dc80265e64a10a8a817552c34153361ed0c017f9f02) + set(platform linux) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(sha256sum 21915277db59756bfc61f6f281c1f5e3897760b63776fd3d360f77dd7364137f) + set(platform mac) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(sha256sum d0ee3da143211aa447e750085876c9b9d7bcdd637ab5b2c5b41349c617f22f3b) + set(platform win) +else() + message(FATAL_ERROR "Unrecognized platform ${CMAKE_HOST_SYSTEM_NAME}") +endif() + +set(tarball "ninja-${platform}.zip") + +file(DOWNLOAD + "https://github.com/ninja-build/ninja/releases/download/v${version}/${tarball}" $ENV{CI_ROOT_DIR}/.local/bin/${tarball} + EXPECTED_HASH SHA256=${sha256sum} + SHOW_PROGRESS + ) + +execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xf ${tarball} + WORKING_DIRECTORY $ENV{CI_ROOT_DIR}/.local/bin + RESULT_VARIABLE extract_results + ) + +if(extract_results) + message(FATAL_ERROR "Extracting `${tarball}` failed: ${extract_results}.") +endif() diff --git a/scripts/ci/gh-actions/linux-setup.sh b/scripts/ci/gh-actions/linux-setup.sh index ee5ac3d537..d71c301f21 100755 --- a/scripts/ci/gh-actions/linux-setup.sh +++ b/scripts/ci/gh-actions/linux-setup.sh @@ -1,17 +1,31 @@ -#!/bin/bash +#!/bin/bash --login -set -e +set -ex export CI_ROOT_DIR="${GITHUB_WORKSPACE}/.." export CI_SOURCE_DIR="${GITHUB_WORKSPACE}" +declare -r local_scripts_dir="$(dirname -- $0)/config" + +echo "**********Install dependencies Begin**********" + +mkdir -p "${CI_ROOT_DIR}/.local/bin" || true + +# Append bin to the workflow PATH file +echo "${CI_ROOT_DIR}/.local/bin" >> "$GITHUB_PATH" + +find "$local_scripts_dir" -type f -name '*.sh' -perm /a=x -exec ./{} \; +find "$local_scripts_dir" -type f -name '*.cmake' -exec cmake --trace -VV -P {} \; + +echo "**********Install dependencies End**********" + SETUP_SCRIPT=${CI_SOURCE_DIR}/scripts/ci/setup/ci-${GH_YML_JOBNAME}.sh if [ -x "${SETUP_SCRIPT}" ] then echo "**********Setup Begin**********" - echo ${SETUP_SCRIPT} - ${SETUP_SCRIPT} + echo "${SETUP_SCRIPT}" + "${SETUP_SCRIPT}" echo "**********Setup End**********" fi