# Test goal: Initial build with close-to-default settings that always needs to pass before follow-up CI stages run # Test intents (should change rarely and conservatively): # OS: Ubuntu oldest supported # Compiler: Clang # Build type: Debug # CMake: oldest supported # GPU: no # SIMD: no # Scope: configure, build, unit tests # Test implementation choices (free to change as needed): # OS: Ubuntu 20.04 # Compiler: Clang 12 # FFT: FFTW3 # Parallelism nt/ntomp: 4/2 simple-build: # Test scope: configure, build, unit tests extends: - .variables:default - .use-ccache - .use-clang:base - .rules:basic-push stage: pre-build image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-12 variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake KUBERNETES_CPU_LIMIT: 8 KUBERNETES_CPU_REQUEST: 4 KUBERNETES_MEMORY_REQUEST: 8Gi CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None" CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON" CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF" CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug" CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF" CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF" COMPILER_MAJOR_VERSION: 12 BUILD_DIR: simple-build script: - CMAKE=${CMAKE:-$(which cmake)} - echo $CMAKE_COMPILER_SCRIPT - echo $CMAKE_EXTRA_OPTIONS - echo $CMAKE_SIMD_OPTIONS - echo $CMAKE_GPU_OPTIONS - echo $CMAKE_MPI_OPTIONS - echo $CMAKE_PRECISION_OPTIONS - echo $CMAKE_BUILD_TYPE_OPTIONS - echo $CMAKE_GMXAPI_OPTIONS - if [[ -d $BUILD_DIR ]] ; then echo "Cleaning up build directory" ; rm -rf $BUILD_DIR && mkdir $BUILD_DIR ; else echo "Preparing new build directory" ; mkdir $BUILD_DIR ; fi - cd $BUILD_DIR - which $CMAKE - $CMAKE --version - $CMAKE .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $CMAKE_COMPILER_SCRIPT $CMAKE_EXTRA_OPTIONS $CMAKE_SIMD_OPTIONS $CMAKE_MPI_OPTIONS $CMAKE_PRECISION_OPTIONS $CMAKE_BUILD_TYPE_OPTIONS $CMAKE_GPU_OPTIONS $CMAKE_GMXAPI_OPTIONS -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON 2>&1 | tee cmakeLog.log - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log - if [ -s cmakeErrors.log ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi - $CMAKE --build . -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee buildLogFile.log - $CMAKE --build . --target tests -- -j$KUBERNETES_CPU_LIMIT 2>&1 | tee testBuildLogFile.log - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log | grep -v "CMake" | tee buildErrors.log || true - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true - $CMAKE --build . --target install 2>&1 | tee installBuildLogFile.log - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true - awk '/The following tests FAILED/,/^Errors while running CTest|^$/' ctestLog.log | tee ctestErrors.log - xsltproc $CI_PROJECT_DIR/scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml - if [ -s ctestErrors.log ] ; then echo "Error during running ctest"; exit 1; fi - cd .. artifacts: reports: junit: $BUILD_DIR/JUnitTestResults.xml paths: - $BUILD_DIR/*log when: always expire_in: 1 week