diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f1eed7f100..d481ad346f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - init-status - sync + - trigger_pipeline - build - code_quality - deploy @@ -151,7 +152,7 @@ status_pending: refs: - develop - master - - tags + - tags tags: - private_ci - cpu @@ -222,413 +223,65 @@ sync: - private_ci - cpu - -# Build jobs -# Job with example runs. -build/cuda90/gcc/all/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda90-gnu5-llvm39 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - RUN_EXAMPLES: "ON" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda90/clang/all/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda90-gnu5-llvm39 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# cuda 9.1 and friends -build/cuda91/gcc/all/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda91-gnu6-llvm40 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda91/clang/all/release/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda91-gnu6-llvm40 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - - -# cuda 9.2 and friends -build/cuda92/gcc/all/release/debug: - <<: *default_build_with_test - image: localhost:5000/gko-cuda92-gnu7-llvm50-intel2017 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# Make sure that our jobs run when HWLOC is -# forcibly switched off -build/cuda92/intel/cuda/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda92-gnu7-llvm50-intel2017 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HWLOC: "OFF" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# cuda 10.0 and friends -# Make sure that our jobs run when using self-installed -# third-party HWLOC. -build/cuda100/gcc/all/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda100-gnu7-llvm60-intel2018 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Debug" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda100/clang/all/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda100-gnu7-llvm60-intel2018 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda100/intel/cuda/release/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda100-gnu7-llvm60-intel2018 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# cuda 10.1 and friends -build/cuda101/gcc/all/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Debug" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda101/clang/all/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# clang-cuda with cuda 10.1 and friends -build/clang-cuda101/gcc/all/release/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda101-gnu8-llvm10-intel2019 - variables: - <<: *default_variables - CUDA_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/clang-cuda101/clang/cuda/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda101-gnu8-llvm10-intel2019 +trigger_pipeline: + stage: trigger_pipeline + image: localhost:5000/gko-nocuda-gnu9-llvm8 variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - CUDA_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 + STATUS_CONTEXT: "quick" + script: + - PR_ID=$(curl "https://api.github.com/search/issues?q=sha:${CI_COMMIT_SHA}" + | jq '.items[0].number') + - | + if [[ "${PR_ID}" != "null" ]]; then + echo "Find the corresponding Pull Request - ${PR_ID}" + echo "Check whether the labels contain ST:ready-to-merge or ST:run-full-test" + ENABLE_FULL_PIPELINE=$(curl -X GET -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/ginkgo-project/ginkgo/issues/${PR_ID}" | jq -er 'any( [.labels | .[] | .name ] | .[] ; . == "ST:ready-to-merge" or . == "ST:run-full-test")') + if [[ "${ENABLE_FULL_PIPELINE}" == "true" ]]; then + echo "trigger full pipeline" + curl -X POST -F token=${CI_JOB_TOKEN} -F "ref=${CI_COMMIT_REF_NAME}" -F "variables[STATUS_CONTEXT]=full" https://gitlab.com/api/v4/projects/6431537/trigger/pipeline + else + echo "does not contain required label" + fi + else + echo "Can not find the Pull Request" + fi only: variables: - - $RUN_CI_TAG + - $RUN_CI_TAG && $STATUS_CONTEXT == "quick" + except: + refs: + - develop + - master + - tags tags: - private_ci - - cuda - - gpu - -# cuda 10.2 and friends + - cpu -# works when there is no hwloc and tpl hwloc is also switched off. -build/cuda102/gcc/all/debug/shared: +# HIP AMD +build/amd/gcc/hip/debug/shared: <<: *default_build_with_test - image: localhost:5000/gko-cuda102-gnu8-llvm8-intel2019 + image: localhost:5000/gko-amd-gnu8-llvm7 variables: <<: *default_variables BUILD_OMP: "ON" - BUILD_CUDA: "ON" BUILD_HIP: "ON" + RUN_EXAMPLES: "ON" BUILD_TYPE: "Debug" - BUILD_HWLOC: "OFF" - CUDA_ARCH: 35 only: variables: - - $RUN_CI_TAG + - $RUN_CI_TAG && $STATUS_CONTEXT == "full" + refs: + - develop + - master + - tags tags: - private_ci - - cuda + - amd - gpu -# Use TPL hwloc when no system hwloc is available -build/cuda102/clang/all/release/static: +build/amd/clang/hip/release/static: <<: *default_build_with_test - image: localhost:5000/gko-cuda102-gnu8-llvm8-intel2019 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda102/intel/cuda/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda102-gnu8-llvm8-intel2019 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# cuda 11.0 and friends -build/cuda110/gcc/cuda/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-cuda110-gnu9-llvm9-intel2020 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda110/clang/cuda/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda110-gnu9-llvm9-intel2020 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -build/cuda110/intel/cuda/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-cuda110-gnu9-llvm9-intel2020 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - CUDA_ARCH: 35 - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# HIP AMD -build/amd/gcc/hip/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-amd-gnu8-llvm7 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_HIP: "ON" - RUN_EXAMPLES: "ON" - BUILD_TYPE: "Debug" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - amd - - gpu - -build/amd/clang/hip/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-amd-gnu8-llvm7 + image: localhost:5000/gko-amd-gnu8-llvm7 variables: <<: *default_variables C_COMPILER: "clang" @@ -645,311 +298,6 @@ build/amd/clang/hip/release/static: - amd - gpu -# no cuda but latest gcc and clang -build/nocuda/gcc/core/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - BUILD_REFERENCE: "OFF" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - BUILD_HWLOC: "OFF" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cpu - -build/nocuda/clang/core/release/shared: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_REFERENCE: "OFF" - BUILD_TYPE: "Release" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cpu - -build/nocuda/intel/core/debug/shared: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_REFERENCE: "OFF" - BUILD_TYPE: "Debug" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - cpu - -build/nocuda/gcc/omp/release/shared: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_TYPE: "Release" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cpu - -build/nocuda/clang/omp/debug/static: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - C_COMPILER: "clang" - CXX_COMPILER: "clang++" - BUILD_OMP: "ON" - BUILD_TYPE: "Debug" - BUILD_SHARED_LIBS: "OFF" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cpu - -build/nocuda/intel/omp/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - C_COMPILER: "icc" - CXX_COMPILER: "icpc" - BUILD_OMP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - cpu - -build/dpcpp/cpu/release/static: - <<: *default_build_with_test - image: localhost:5000/gko-oneapi - variables: - <<: *default_variables - C_COMPILER: "gcc" - CXX_COMPILER: "dpcpp" - BUILD_DPCPP: "ON" - BUILD_TYPE: "Release" - BUILD_SHARED_LIBS: "OFF" - SYCL_DEVICE_TYPE: "CPU" - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - cpu - -# Job with important warnings as error -warnings: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - CXX_FLAGS: "-Werror=pedantic -pedantic-errors" - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: yes - tags: - - private_ci - - cuda - - gpu - -# Ensure kernel modules do not depend on core -no-circular-deps: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - EXTRA_CMAKE_FLAGS: '-DGINKGO_CHECK_CIRCULAR_DEPS=on' - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: no - tags: - - private_ci - - cuda - - gpu - -# Ensure Ginkgo builds from a subdirectory -subdir-build: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - BUILD_OMP: "ON" - CI_PROJECT_PATH_SUFFIX: "/test_subdir" - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: no - tags: - - private_ci - - cpu - -# Ensure Ginkgo can be used when exporting the build directory -export-build: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-nocuda-gnu9-llvm8 - variables: - <<: *default_variables - BUILD_OMP: "ON" - EXPORT_BUILD_DIR: "ON" - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: no - tags: - - private_ci - - cpu - -# Run clang-tidy and iwyu -clang-tidy: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_HIP: "ON" - EXTRA_CMAKE_FLAGS: '-DGINKGO_WITH_CLANG_TIDY=ON' - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: yes - tags: - - private_ci - - cuda - - gpu - -iwyu: - <<: *default_build - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - variables: - <<: *default_variables - BUILD_OMP: "ON" - BUILD_CUDA: "ON" - BUILD_CUDA: "HIP" - EXTRA_CMAKE_FLAGS: '-DGINKGO_WITH_IWYU=ON' - only: - variables: - - $RUN_CI_TAG - dependencies: [] - allow_failure: yes - tags: - - private_ci - - cuda - - gpu - -# Code analysis, coverage and reporting tool -# For short living branches or PRs, try to detect an open PR -sonarqube_cov_: - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - before_script: *default_before_script - script: - - PR_ID=$(curl "https://api.github.com/search/issues?q=sha:${CI_COMMIT_SHA}" - | jq '.items[0].number') - - if [[ "${PR_ID}" != "null" ]]; then - target_branch=$(curl - "https://api.github.com/repos/ginkgo-project/ginkgo/pulls/${PR_ID}" | jq - '.base.ref' | sed 's/"//g'); - sonar_branching="-Dsonar.pullrequest.branch=${CI_COMMIT_REF_NAME} - -Dsonar.pullrequest.base=${target_branch} - -Dsonar.pullrequest.key=${PR_ID}"; - else - sonar_branching="-Dsonar.branch.name=${CI_COMMIT_REF_NAME} - -Dsonar.branch.target=develop"; - fi - - ctest -S cmake/CTestScript.cmake -DCTEST_BUILD_CONFIGURATION=COVERAGE - -DGINKGO_SONARQUBE_TEST=ON - - sonar-scanner -Dsonar.login=${SONARQUBE_LOGIN} - -Dsonar.cfamily.build-wrapper-output=build/bw-output - -Dsonar.cfamily.gcov.reportsPath=build/Testing/CoverageInfo - ${sonar_branching} - - bash <(curl -s https://codecov.io/bash) -f "\!*examples*" -f "\!*third_party*" -f "\!*c\\+\\+*" -f "\!*benchmark*" - dependencies: [] - except: - refs: - - develop - - master - - tags - only: - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - -# For long living branches, do not detect the PR. A PR would always be detected -# (the one that was merged). -sonarqube_cov: - stage: code_quality - image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 - before_script: *default_before_script - script: - - ctest -S cmake/CTestScript.cmake -DCTEST_BUILD_CONFIGURATION=COVERAGE - -DGINKGO_SONARQUBE_TEST=ON - - sonar-scanner -Dsonar.login=${SONARQUBE_LOGIN} - -Dsonar.cfamily.build-wrapper-output=build/bw-output - -Dsonar.cfamily.gcov.reportsPath=build/Testing/CoverageInfo - -Dsonar.branch.name=${CI_COMMIT_REF_NAME} - - bash <(curl -s https://codecov.io/bash) -f "\!*examples*" -f "\!*third_party*" -f "\!*c\\+\\+*" -f "\!*benchmark*" - dependencies: [] - only: - refs: - - develop - - master - - tags - variables: - - $RUN_CI_TAG - tags: - - private_ci - - cuda - - gpu - # Deploy documentation to github-pages gh-pages: