Skip to content
Snippets Groups Projects
Commit d1b29fe8 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Merge branch 'feature/ci' into 'develop'

Feature/ci

See merge request !19
parents e7b85be9 d8ae0c63
No related branches found
No related tags found
1 merge request!19Feature/ci
image: localhost:5000/ubuntu_gcc
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- build/
untracked: true
stages:
- build
- test
- deploy
build:coverage:
stage: build
script:
- mkdir -p build
- cd build
- CXX=g++-7 CC=gcc-7 cmake .. -DCMAKE_BUILD_TYPE=Coverage
- make pugs
variables:
CTEST_OUTPUT_ON_FAILURE: 1
test:coverage:
stage: test
dependencies:
- build:coverage
script:
- cd build
- make run_unit_tests
- make coverage
include:
- local: '/.gitlab-ci/gcc8-seq-dbg.yml'
- local: '/.gitlab-ci/gcc8-seq-release.yml'
- local: '/.gitlab-ci/clang8-seq-coverage.yml'
- local: '/.gitlab-ci/clang8-seq-release.yml'
- local: '/.gitlab-ci/clang8-mpi-coverage.yml'
- local: '/.gitlab-ci/clang8-mpi-release.yml'
build:clang8-mpi-coverage:
image: localhost:5000/ubuntu_clang8_mpi
stage: build
script:
- mkdir -p build/clang8-cov-mpi
- cd build/clang8-cov-mpi
- CXX=clang++-8 CC=clang-8 cmake ../.. -DCMAKE_BUILD_TYPE=Coverage -DCLANG_FORMAT=/usr/bin/clang-format-8
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-cov-mpi"
paths:
- build/clang8-cov-mpi
untracked: true
test:clang8-mpi-coverage:
image: localhost:5000/ubuntu_clang8_mpi
stage: test
dependencies:
- build:clang8-mpi-coverage
script:
- cd build/clang8-cov-mpi
- make coverage
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-cov-mpi"
paths:
- build/clang8-cov-mpi
untracked: true
build:clang8-mpi-release:
image: localhost:5000/ubuntu_clang8_mpi
stage: build
script:
- mkdir -p build/clang8-release-mpi
- cd build/clang8-release-mpi
- CXX=clang++-8 CC=clang-8 cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCLANG_FORMAT=/usr/bin/clang-format-8
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-release-mpi"
paths:
- build/clang8-release-mpi
untracked: true
test:clang8-mpi-release:
image: localhost:5000/ubuntu_clang8_mpi
stage: test
dependencies:
- build:clang8-mpi-release
script:
- cd build/clang8-release-mpi
- make run_unit_tests
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-release-mpi"
paths:
- build/clang8-release-mpi
untracked: true
build:clang8-seq-coverage:
image: localhost:5000/ubuntu_clang8
stage: build
script:
- mkdir -p build/clang8-cov
- cd build/clang8-cov
- CXX=clang++-8 CC=clang-8 cmake ../.. -DCMAKE_BUILD_TYPE=Coverage -DCLANG_FORMAT=/usr/bin/clang-format-8
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-cov"
paths:
- build/clang8-cov
untracked: true
test:clang8-seq-coverage:
image: localhost:5000/ubuntu_clang8
stage: test
dependencies:
- build:clang8-seq-coverage
script:
- cd build/clang8-cov
- make coverage
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-cov"
paths:
- build/clang8-cov
untracked: true
build:clang8-seq-release:
image: localhost:5000/ubuntu_clang8
stage: build
script:
- mkdir -p build/clang8-release-seq
- cd build/clang8-release-seq
- CXX=clang++-8 CC=clang-8 cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCLANG_FORMAT=/usr/bin/clang-format-8
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-release-seq"
paths:
- build/clang8-release-seq
untracked: true
test:clang8-seq-release:
image: localhost:5000/ubuntu_clang8
stage: test
dependencies:
- build:clang8-seq-release
script:
- cd build/clang8-release-seq
- make run_unit_tests
cache:
key: "${CI_COMMIT_REF_SLUG}-clang8-release-seq"
paths:
- build/clang8-release-seq
untracked: true
build:gcc8-seq-dbg:
image: localhost:5000/ubuntu_gcc8
stage: build
script:
- mkdir -p build/gcc8-seq-dbg
- cd build/gcc8-seq-dbg
- CXX=g++-8 CC=gcc-8 cmake ../.. -DCMAKE_BUILD_TYPE=Debug
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-gcc8-seq-dbg"
paths:
- build/gcc8-seq-dbg
untracked: true
test:gcc8-seq-dbg:
image: localhost:5000/ubuntu_gcc8
stage: test
dependencies:
- build:gcc8-seq-dbg
script:
- cd build/gcc8-seq-dbg
- make run_unit_tests
cache:
key: "${CI_COMMIT_REF_SLUG}-gcc8-seq-dbg"
paths:
- build/gcc8-seq-dbg
untracked: true
build:gcc8-seq-release:
image: localhost:5000/ubuntu_gcc8
stage: build
script:
- mkdir -p build/gcc8-seq-release
- cd build/gcc8-seq-release
- CXX=g++-8 CC=gcc-8 cmake ../.. -DCMAKE_BUILD_TYPE=Release
- make pugs
cache:
key: "${CI_COMMIT_REF_SLUG}-gcc8-seq-release"
paths:
- build/gcc8-seq-release
untracked: true
test:gcc8-seq-release:
image: localhost:5000/ubuntu_gcc8
stage: test
dependencies:
- build:gcc8-seq-release
script:
- cd build/gcc8-seq-release
- make run_unit_tests
cache:
key: "${CI_COMMIT_REF_SLUG}-gcc8-seq-release"
paths:
- build/gcc8-seq-release
untracked: true
......@@ -219,6 +219,12 @@ add_subdirectory("${CATCH_MODULE_PATH}")
add_subdirectory(tests)
enable_testing()
add_custom_target(run_unit_tests
COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
DEPENDS unit_tests mpi_unit_tests
COMMENT "Executing unit tests."
)
# unit tests coverage
if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
......@@ -244,17 +250,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA})
add_custom_target(run_unit_tests
ALL
COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
DEPENDS unit_tests mpi_unit_tests pugs
COMMENT "Executing unit tests."
)
add_custom_target(coverage
ALL
COMMAND ${GCOVR} ${GCOVR_OPTIONS} --exclude-unreachable-branches --sort-percentage
DEPENDS run_unit_tests
DEPENDS run_unit_tests pugs
COMMENT "Running gcovr to build coverage report."
)
......
......@@ -40,7 +40,11 @@ enable_testing()
ParseAndAddCatchTests(unit_tests)
if(${PUGS_HAS_MPI})
set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 --oversubscribe --path ${PUGS_BINARY_DIR})
set(MPIEXEC_OPTION_FLAGS --oversubscribe)
if (NOT "$ENV{GITLAB_CI}" STREQUAL "")
set(MPIEXEC_OPTION_FLAGS ${MPIEXEC_OPTION_FLAGS} --allow-run-as-root)
endif()
set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ${MPIEXEC_OPTION_FLAGS} --path ${PUGS_BINARY_DIR})
endif()
ParseAndAddCatchTests(mpi_unit_tests)
unset(OptionalCatchTestLauncher)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment