Reintroduce CI job descriptions
[alexxy/gromacs.git] / admin / gitlab-ci / gromacs.gitlab-ci.yml
1 # Test goal: Initial build with close-to-default settings that always needs to pass before follow-up CI stages run
2 # Test intents (should change rarely and conservatively):
3 #   OS: Ubuntu oldest supported
4 #   Compiler: Clang
5 #   Build type: Debug
6 #   GPU: no
7 #   SIMD: no
8 #   Scope: configure, build, unit tests
9 # Test implementation choices (free to change as needed):
10 #   OS: Ubuntu 18.04
11 #   Compiler: Clang 9
12 #   FFT: FFTW3
13 #   Parallelism nt/ntomp: 4/2
14
15 simple-build:
16   # Test scope: configure, build, unit tests
17   extends:
18     - .variables:default
19     - .use-ccache
20     - .use-clang:base
21     - .rules:basic-push
22   stage: pre-build
23   image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9
24   variables:
25     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
26     KUBERNETES_CPU_LIMIT: 8
27     KUBERNETES_CPU_REQUEST: 4
28     KUBERNETES_MEMORY_REQUEST: 8Gi
29     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
30     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
31     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
32     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
33     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
34     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
35     COMPILER_MAJOR_VERSION: 9
36     BUILD_DIR: simple-build
37   script:
38     - CMAKE=${CMAKE:-$(which cmake)}
39     - echo $CMAKE_COMPILER_SCRIPT
40     - echo $CMAKE_EXTRA_OPTIONS
41     - echo $CMAKE_SIMD_OPTIONS
42     - echo $CMAKE_GPU_OPTIONS
43     - echo $CMAKE_MPI_OPTIONS
44     - echo $CMAKE_PRECISION_OPTIONS
45     - echo $CMAKE_BUILD_TYPE_OPTIONS
46     - echo $CMAKE_GMXAPI_OPTIONS
47     - if [[ -d $BUILD_DIR ]] ; then
48       echo "Cleaning up build directory" ;
49       rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
50       else
51       echo "Preparing new build directory" ;
52       mkdir $BUILD_DIR ;
53       fi
54     - cd $BUILD_DIR
55     - $CMAKE ..
56       -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
57       $CMAKE_COMPILER_SCRIPT
58       $CMAKE_EXTRA_OPTIONS
59       $CMAKE_SIMD_OPTIONS
60       $CMAKE_MPI_OPTIONS
61       $CMAKE_PRECISION_OPTIONS
62       $CMAKE_BUILD_TYPE_OPTIONS
63       $CMAKE_GPU_OPTIONS
64       $CMAKE_GMXAPI_OPTIONS
65       -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
66       2>&1 | tee cmakeLog.log
67     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
68     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
69     - $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log
70     - $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log
71     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
72       | grep -v "CMake" | tee buildErrors.log || true
73     - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
74     - $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log
75     - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
76     - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
77     - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
78       ctestLog.log | tee ctestErrors.log
79     - xsltproc $CI_PROJECT_DIR/scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
80     - if [ -s ctestErrors.log ] ; then
81       echo "Error during running ctest";
82       exit 1;
83       fi
84     - cd ..
85   artifacts:
86     reports:
87       junit: $BUILD_DIR/JUnitTestResults.xml
88     paths:
89       - $BUILD_DIR/*log
90     when: always
91     expire_in: 1 week