b8e2190c94fd112a069e760c7672a42fa8ab326a
[alexxy/gromacs.git] / admin / gitlab-ci / gromacs.matrix / gromacs.gcc-10-coverage.gitlab-ci.yml
1 # Test goal: code coverage with newest GCC
2 # Test intents (should change rarely and conservatively):
3 #   OS: Ubuntu newest supported
4 #   Compiler: GCC newest supported
5 #   GPU: no
6 #   Scope: configure, build, unit tests, coverage
7 # Test implementation choices (free to change as needed):
8 #   OS: Ubuntu 20.04
9 #   Build type: Debug
10 #   Compiler: GCC 10
11 #   MPI: thread_MPI
12 #   SIMD: AVX2_256
13 #   Parallelism nt/ntomp: 4/2 (unit tests)
14
15 gromacs:gcc-10:coverage:configure:
16   extends:
17     - .gromacs:base:configure
18     - .use-gcc:base
19     - .rules:post-merge-acceptance
20   image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
21   variables:
22     CMAKE: /usr/local/cmake-3.18.4/bin/cmake
23     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AVX2_256"
24     CMAKE_EXTRA_OPTIONS: "-DGMX_BUILD_FOR_COVERAGE=ON"
25     COMPILER_MAJOR_VERSION: 10
26
27 gromacs:gcc-10:coverage:build:
28   extends:
29     - .variables:default
30     - .gromacs:base:build
31     - .before_script:default
32     - .use-ccache
33     - .rules:post-merge-acceptance
34   image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
35   variables:
36     CMAKE: /usr/local/cmake-3.18.4/bin/cmake
37   needs:
38     - job: gromacs:gcc-10:coverage:configure
39
40 gromacs:gcc-10:coverage:test:
41   extends:
42     - .gromacs:base:test
43     - .rules:post-merge-acceptance
44   image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
45   variables:
46     CMAKE: /usr/local/cmake-3.18.4/bin/cmake
47   tags:
48     - k8s-scilifelab
49   needs:
50     - job: gromacs:gcc-10:coverage:build
51   artifacts:
52     paths:
53       - $BUILD_DIR
54
55 gromacs:coverage:analyse:
56   variables:
57     CMAKE: /usr/local/cmake-3.18.4/bin/cmake
58     VENVPATH: "/root/venv/py3.7"
59     GCOVR_GENERAL_OPTIONS: "-r ../ /. --gcov-executable=gcov-10 --exclude-unreachable-branches --exclude-throw-branches -j$KUBERNETES_CPU_LIMIT"
60     GCOVR_EXCLUDE_OPTIONS: "--exclude-directories '^src/external/.*' --exclude-directories '^src/gromacs/selection/.*' --exclude-directories '.*tests.*" 
61   extends:
62     - .variables:default
63     - .rules:post-merge-acceptance
64   stage: post-test
65   image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
66   needs:
67     - job: gromacs:gcc-10:coverage:build
68     - job: gromacs:gcc-10:coverage:test
69
70   tags:
71     - k8s-scilifelab
72   script:
73     - echo ${GCOVR_GENERAL_OPTIONS}
74     - echo ${GCOVR_EXCLUDE_OPTIONS}
75     - source $VENVPATH/bin/activate
76     - mkdir public
77     - outputdir=`pwd`/public
78     - cd $BUILD_DIR
79     # run gcovr to write to stdout for GitLab pipeline grep.
80     - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS}
81     # run gcovr to generate xml output. keep the generated files to produce the html output later.
82     # the invocations need to be separate due to a crash in gcovr where files can not be found.
83     - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS} --xml $outputdir/cobertura-coverage.xml --xml-pretty --keep
84     # final gcovr run, using the generated files to produce nice looking html output
85     - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS} --html $outputdir/coverage.html --use-gcov-files
86   artifacts:
87     paths:
88       - public/
89     reports:
90       cobertura: public/cobertura-coverage.xml