Remove some unnecessary indirection in job definitions.
[alexxy/gromacs.git] / admin / gitlab-ci / testing-matrix.gitlab-ci.yml
1
2 # Initial build that always needs to pass before follow-up stages run
3 simple-build:
4   extends:
5     - .use-ccache
6     - .variables:default
7     - .use-gcc7
8   stage: pre-build
9   variables:
10     KUBERNETES_CPU_LIMIT: 8
11     KUBERNETES_CPU_REQUEST: 4
12     KUBERNETES_MEMORY_LIMIT: 8Gi
13     CMAKE_COMPILER_SCRIPT: ""
14     CMAKE_EXTRA_OPTIONS: ""
15     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
16     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
17     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
18     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
19     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
20     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
21     BUILD_DIR: simple-build
22   except:
23     variables:
24       - $GROMACS_RELEASE
25   script:
26     - echo $CMAKE_COMPILER_SCRIPT
27     - echo $CMAKE_EXTRA_OPTIONS
28     - echo $CMAKE_SIMD_OPTIONS
29     - echo $CMAKE_GPU_OPTIONS
30     - echo $CMAKE_MPI_OPTIONS
31     - echo $CMAKE_PRECISION_OPTIONS
32     - echo $CMAKE_BUILD_TYPE_OPTIONS
33     - echo $CMAKE_GMXAPI_OPTIONS
34     - if [[ -d $BUILD_DIR ]] ; then
35       echo "Cleaning up build directory" ;
36       rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
37       else
38       echo "Preparing new build directory" ;
39       mkdir $BUILD_DIR ;
40       fi
41     - cd $BUILD_DIR
42     - cmake ..
43       -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
44       $CMAKE_COMPILER_SCRIPT
45       $CMAKE_EXTRA_OPTIONS
46       $CMAKE_SIMD_OPTIONS
47       $CMAKE_MPI_OPTIONS
48       $CMAKE_PRECISION_OPTIONS
49       $CMAKE_BUILD_TYPE_OPTIONS
50       $CMAKE_GPU_OPTIONS
51       $CMAKE_GMXAPI_OPTIONS
52       -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
53       2>&1 | tee cmakeLog.log
54     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
55     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
56     - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
57     - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
58     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
59       | grep -v "CMake" | tee buildErrors.log || true
60     - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
61     - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
62     - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
63     - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
64     - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
65       ctestLog.log | tee ctestErrors.log
66     - xsltproc scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
67     - if [ -s ctestErrors.log ] ; then
68       echo "Error during running ctest";
69       exit 1;
70       fi
71     - cd ..
72   artifacts:
73     reports:
74       junit: $BUILD_DIR/JUnitTestResults.xml
75     paths:
76       - $BUILD_DIR/*log
77     when: always
78     expire_in: 1 week
79
80 # Jobs running in first pre-build stage
81
82 .configure-extends-template:
83   extends:
84     - .variables:default
85   cache: {}
86   stage: configure-build
87   variables:
88     KUBERNETES_CPU_LIMIT: 1
89     KUBERNETES_CPU_REQUEST: 1
90     KUBERNETES_MEMORY_LIMIT: 2Gi
91     CMAKE_COMPILER_SCRIPT: ""
92     CMAKE_EXTRA_OPTIONS: ""
93     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
94     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
95     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
96     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
97     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
98     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
99   script:
100     - echo $CMAKE_COMPILER_SCRIPT
101     - echo $CMAKE_EXTRA_OPTIONS
102     - echo $CMAKE_SIMD_OPTIONS
103     - echo $CMAKE_GPU_OPTIONS
104     - echo $CMAKE_MPI_OPTIONS
105     - echo $CMAKE_PRECISION_OPTIONS
106     - echo $CMAKE_BUILD_TYPE_OPTIONS
107     - echo $CMAKE_GMXAPI_OPTIONS
108     - if [[ -d $BUILD_DIR ]] ; then
109       rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
110       else
111       echo "Preparing new build directory" ;
112       mkdir $BUILD_DIR ;
113       fi
114     - cd $BUILD_DIR
115     - cmake ..
116       -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
117       $CMAKE_COMPILER_SCRIPT
118       $CMAKE_EXTRA_OPTIONS
119       $CMAKE_SIMD_OPTIONS
120       $CMAKE_MPI_OPTIONS
121       $CMAKE_PRECISION_OPTIONS
122       $CMAKE_BUILD_TYPE_OPTIONS
123       $CMAKE_GPU_OPTIONS
124       $CMAKE_GMXAPI_OPTIONS
125       -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
126       2>&1 | tee cmakeLog.log
127     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
128     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
129     - cd ..
130   artifacts:
131     when: always
132     paths:
133       - $BUILD_DIR
134
135 .configure-release-extends-template:
136   extends:
137     - .variables:default
138   cache: {}
139   stage: release-configure
140   variables:
141     KUBERNETES_CPU_LIMIT: 1
142     KUBERNETES_CPU_REQUEST: 1
143     KUBERNETES_MEMORY_LIMIT: 2Gi
144     CMAKE_COMPILER_SCRIPT: ""
145     CMAKE_EXTRA_OPTIONS: ""
146     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
147     CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
148     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
149     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
150     CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
151     CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
152     RELEASE_BUILD_DIR: release-builds
153     RELEASE_SOURCE: release-source-from-tarball
154     RELEASE_REGRESSIONTESTS: release-regressiontests-from-tarball
155   only:
156     refs:
157       - web
158       - schedules
159       - triggers
160     variables:
161       - $GROMACS_RELEASE
162   script:
163     - VERSION=`cat version.json |
164       python3 -c "import json,sys; print(json.load(sys.stdin)['version'])"`
165     - if [[ $GROMACS_RELEASE != "true" ]] ; then
166       VERSION=$VERSION-dev ;
167       fi
168     - SOURCENAME=gromacs-$VERSION
169     - SOURCETARBALL=$SOURCENAME.tar.gz
170     - REGTESTNAME=regressiontests-$VERSION
171     - REGTESTTARBALL=$REGTESTNAME.tar.gz
172     - echo "$SOURCETARBALL"
173     - echo "$REGTESTTARBALL"
174     - RELEASE_TARBALLS=release-tarballs
175     - rm -rf $RELEASE_TARBALLS $RELEASE_SOURCE $RELEASE_REGRESSIONTESTS && mkdir $RELEASE_TARBALLS
176     - mv $SOURCETARBALL $RELEASE_TARBALLS
177     - mv $REGTESTTARBALL $RELEASE_TARBALLS
178     - cd $RELEASE_TARBALLS
179     # We rename the source and regressiontest directories
180     # to have names for them that don't change for different versions.
181     - tar -xf $SOURCETARBALL
182     - mv $SOURCENAME ../$RELEASE_SOURCE
183     - tar -xf $REGTESTTARBALL
184     - mv $REGTESTNAME ../$RELEASE_REGRESSIONTESTS
185     - rm $SOURCETARBALL $REGTESTTARBALL
186     - cd ..
187     - echo $CMAKE_COMPILER_SCRIPT
188     - echo $CMAKE_EXTRA_OPTIONS
189     - echo $CMAKE_SIMD_OPTIONS
190     - echo $CMAKE_GPU_OPTIONS
191     - echo $CMAKE_MPI_OPTIONS
192     - echo $CMAKE_PRECISION_OPTIONS
193     - echo $CMAKE_BUILD_TYPE_OPTIONS
194     - echo $CMAKE_GMXAPI_OPTIONS
195     - if [[ -d $RELEASE_BUILD_DIR ]] ; then
196       echo "Cleaning up build directory" ;
197       rm -rf $RELEASE_BUILD_DIR && mkdir $RELEASE_BUILD_DIR ;
198       else
199       echo "Preparing new build directory" ;
200       mkdir $RELEASE_BUILD_DIR ;
201       fi
202     - cd $RELEASE_BUILD_DIR
203     - cmake ../$RELEASE_SOURCE/
204       -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
205       $CMAKE_COMPILER_SCRIPT
206       $CMAKE_EXTRA_OPTIONS
207       $CMAKE_SIMD_OPTIONS
208       $CMAKE_MPI_OPTIONS
209       $CMAKE_PRECISION_OPTIONS
210       $CMAKE_BUILD_TYPE_OPTIONS
211       $CMAKE_GPU_OPTIONS
212       $CMAKE_GMXAPI_OPTIONS
213       "-DREGRESSIONTEST_PATH=../$RELEASE_REGRESSIONTESTS"
214       -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
215       2>&1 | tee cmakeLog.log
216     - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
217     - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
218     - cd ..
219   artifacts:
220     when: always
221     paths:
222       - $RELEASE_BUILD_DIR
223       - $RELEASE_REGRESSIONTESTS
224       - $RELEASE_SOURCE
225
226 # Templates for configuration stage
227 .configure-gcc-cuda:
228   extends:
229     - .configure-extends-template
230     - .cuda-template
231
232 configure-gcc-7:
233   extends:
234     - .configure-extends-template
235     - .use-gcc7
236   needs:
237     - job: simple-build
238       artifacts: false
239   except:
240     variables:
241       - $GROMACS_RELEASE
242
243 configure-gcc-7-release:
244   extends:
245     - .configure-release-extends-template
246     - .use-gcc7
247   cache: {}
248   variables:
249     RELEASE_BUILD_DIR: release-builds-gcc
250   only:
251     refs:
252       - web
253       - schedules
254       - triggers
255     variables:
256       - $GROMACS_RELEASE
257   dependencies:
258     - package-archive-release
259     - package-regressiontests-release
260     - prepare-release-version
261
262 configure-gcc-7-simd-sse41:
263   extends:
264     - .configure-extends-template
265     - .use-gcc7
266   needs:
267     - job: simple-build
268       artifacts: false
269   variables:
270     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=SSE4.1"
271   except:
272     variables:
273       - $GROMACS_RELEASE
274
275 configure-gcc-7-double:
276   extends:
277     - .configure-extends-template
278     - .use-gcc7
279   needs:
280     - job: simple-build
281       artifacts: false
282   variables:
283     CMAKE_PRECISION_OPTIONS: -DGMX_DOUBLE=ON
284   except:
285     variables:
286       - $GROMACS_RELEASE
287
288 configure-gcc-7-double-release:
289   extends:
290     - .configure-release-extends-template
291     - .use-gcc7
292   cache: {}
293   variables:
294     CMAKE_PRECISION_OPTIONS: -DGMX_DOUBLE=ON
295     RELEASE_BUILD_DIR: release-builds-gcc
296   only:
297     refs:
298       - web
299       - schedules
300       - triggers
301     variables:
302       - $GROMACS_RELEASE
303   dependencies:
304     - package-archive-release
305     - package-regressiontests-release
306     - prepare-release-version
307
308 configure-gcc-7-gmxapi:
309   extends:
310     - .configure-extends-template
311     - .configure-gmxapi-template
312     - .use-gcc7
313   needs:
314     - job: simple-build
315       artifacts: false
316   except:
317     variables:
318       - $GROMACS_RELEASE
319
320 configure-gcc-7-gmxapi-release:
321   extends:
322     - .configure-release-extends-template
323     - .configure-gmxapi-template
324     - .use-gcc7
325   cache: {}
326   variables:
327     RELEASE_BUILD_DIR: release-builds-gcc
328   only:
329     refs:
330       - web
331       - schedules
332       - triggers
333     variables:
334       - $GROMACS_RELEASE
335   dependencies:
336     - package-archive-release
337     - package-regressiontests-release
338     - prepare-release-version
339
340 configure-gcc-8:
341   extends:
342     - .configure-extends-template
343     - .use-gcc8
344   needs:
345     - job: simple-build
346       artifacts: false
347   except:
348     variables:
349       - $GROMACS_RELEASE
350
351 configure-gcc-8-release:
352   extends:
353     - .configure-release-extends-template
354     - .use-gcc8
355   cache: {}
356   variables:
357     RELEASE_BUILD_DIR: release-builds-gcc
358   only:
359     refs:
360       - web
361       - schedules
362       - triggers
363     variables:
364       - $GROMACS_RELEASE
365   dependencies:
366     - package-archive-release
367     - package-regressiontests-release
368     - prepare-release-version
369
370 configure-gcc-8-cuda-10.2:
371   extends:
372     - .configure-gcc-cuda
373     - .use-gcc8:cuda-10.2
374   needs:
375     - job: simple-build
376       artifacts: false
377   except:
378     variables:
379       - $GROMACS_RELEASE
380
381 # For version of clang before 7, we need to always provide the full version
382 # Use something like this instead in the download script:
383 # APT_COMPILER_VERSION=$(($COMPILER_MAJOR_VERSION < 7 ? "${COMPILER_MAJOR_VERSION}.0" : $COMPILER_MAJOR_VERSION))
384 configure-clang-6:
385   extends:
386     - .configure-extends-template
387     - .use-clang6
388   needs:
389     - job: simple-build
390       artifacts: false
391   variables:
392     COMPILER_MAJOR_VERSION: "6.0"
393     CMAKE_MPI_OPTIONS: -DGMX_OPENMP=OFF
394   except:
395     variables:
396       - $GROMACS_RELEASE
397
398 configure-clang-7:
399   extends:
400     - .configure-extends-template
401     - .use-clang7
402   needs:
403     - job: simple-build
404       artifacts: false
405   except:
406     variables:
407       - $GROMACS_RELEASE
408
409 configure-clang-7-release:
410   extends:
411     - .configure-release-extends-template
412     - .use-clang7
413   cache: {}
414   variables:
415     RELEASE_BUILD_DIR: release-builds-clang
416   only:
417     refs:
418       - web
419       - schedules
420       - triggers
421     variables:
422       - $GROMACS_RELEASE
423   dependencies:
424     - package-archive-release
425     - package-regressiontests-release
426     - prepare-release-version
427
428 configure-clang-7-gmxapi:
429   extends:
430     - .configure-extends-template
431     - .configure-gmxapi-template
432     - .use-clang7
433   needs:
434     - job: simple-build
435       artifacts: false
436   except:
437     variables:
438       - $GROMACS_RELEASE
439
440 configure-clang-7-gmxapi-release:
441   extends:
442     - .configure-release-extends-template
443     - .configure-gmxapi-template
444     - .use-clang7
445   cache: {}
446   variables:
447     RELEASE_BUILD_DIR: release-builds-clang
448   only:
449     refs:
450       - web
451       - schedules
452       - triggers
453     variables:
454       - $GROMACS_RELEASE
455   dependencies:
456     - package-archive-release
457     - package-regressiontests-release
458     - prepare-release-version
459
460 configure-clang-8:
461   extends:
462     - .configure-extends-template
463     - .use-clang8
464   needs:
465     - job: simple-build
466       artifacts: false
467   except:
468     variables:
469       - $GROMACS_RELEASE
470
471 configure-clang-8-release:
472   extends:
473     - .configure-release-extends-template
474     - .use-clang8
475   cache: {}
476   variables:
477     RELEASE_BUILD_DIR: release-builds-clang
478   only:
479     refs:
480       - web
481       - schedules
482       - triggers
483     variables:
484       - $GROMACS_RELEASE
485   dependencies:
486     - package-archive-release
487     - package-regressiontests-release
488     - prepare-release-version
489
490 # Jobs running during build stage
491
492 .binary-build-template:
493   # Dockerfiles are from dockerhub, user eriklindahl
494   # image in admin/dockerimages/ci-docs-py27
495   stage: build
496   image: biophysics/gcc-gromacs
497   variables:
498
499   script:
500     - cd $BUILD_DIR
501     - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
502     - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
503     - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
504       | grep -v "CMake" | tee buildErrors.log || true
505     - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
506     - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
507     - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
508     - cd ..
509   artifacts:
510     when: always
511     paths:
512       - $BUILD_DIR
513       - $INSTALL_DIR/
514
515 .build-extends-template:
516   extends:
517     - .binary-build-template
518     - .use-ccache
519     - .variables:default
520
521 .build-gcc-cuda:
522   extends:
523     - .build-extends-template
524     - .cuda-template
525
526 build-gcc-7:
527   extends:
528     - .build-extends-template
529     - .use-gcc7
530   needs:
531     - job: simple-build
532       artifacts: false
533     - job: configure-gcc-7
534       artifacts: true
535   except:
536     variables:
537       - $GROMACS_RELEASE
538
539 build-gcc-7-release:
540   extends:
541     - .build-extends-template
542     - .use-gcc7
543   stage: release-build
544   variables:
545     BUILD_DIR: release-builds-gcc
546   needs:
547     - job: configure-gcc-7-release
548       artifacts: true
549   only:
550     refs:
551       - web
552       - schedules
553       - triggers
554     variables:
555       - $GROMACS_RELEASE
556
557 build-gcc-7-simd-sse41:
558   extends:
559     - .build-extends-template
560     - .use-gcc7
561   needs:
562     - job: simple-build
563       artifacts: false
564     - job: configure-gcc-7-simd-sse41
565       artifacts: true
566   except:
567     variables:
568       - $GROMACS_RELEASE
569
570 build-gcc-7-double:
571   extends:
572     - .build-extends-template
573     - .use-gcc7
574   needs:
575     - job: simple-build
576       artifacts: false
577     - job: configure-gcc-7-double
578       artifacts: true
579   except:
580     variables:
581       - $GROMACS_RELEASE
582
583 build-gcc-7-gmxapi:
584   extends:
585     - .build-extends-template
586     - .gmxapi-extra-installs
587     - .use-gcc7
588   needs:
589     - job: simple-build
590       artifacts: false
591     - job: configure-gcc-7-gmxapi
592       artifacts: true
593   except:
594     variables:
595       - $GROMACS_RELEASE
596
597 build-gcc-7-double-release:
598   extends:
599     - .build-extends-template
600     - .use-gcc7
601   stage: release-build
602   variables:
603     BUILD_DIR: release-builds-gcc
604   needs:
605     - job: configure-gcc-7-double-release
606       artifacts: true
607   only:
608     refs:
609       - web
610       - schedules
611       - triggers
612     variables:
613       - $GROMACS_RELEASE
614
615 build-gcc-7-gmxapi-release:
616   extends:
617     - .build-extends-template
618     - .gmxapi-extra-installs
619     - .use-gcc7
620   stage: release-build
621   variables:
622     BUILD_DIR: release-builds-gcc
623   needs:
624     - job: configure-gcc-7-gmxapi-release
625       artifacts: true
626   only:
627     refs:
628       - web
629       - schedules
630       - triggers
631     variables:
632       - $GROMACS_RELEASE
633
634 build-gcc-8:
635   extends:
636     - .build-extends-template
637     - .use-gcc8
638   needs:
639     - job: simple-build
640       artifacts: false
641     - job: configure-gcc-8
642       artifacts: true
643   except:
644     variables:
645       - $GROMACS_RELEASE
646
647 build-gcc-8-release:
648   extends:
649     - .build-extends-template
650     - .use-gcc8
651   stage: release-build
652   variables:
653     BUILD_DIR: release-builds-gcc
654   needs:
655     - job: configure-gcc-8-release
656       artifacts: true
657   only:
658     refs:
659       - web
660       - schedules
661       - triggers
662     variables:
663       - $GROMACS_RELEASE
664
665 build-gcc-8-cuda-10.2:
666   extends:
667     - .build-gcc-cuda
668     - .use-gcc8:cuda-10.2
669   needs:
670     - job: simple-build
671       artifacts: false
672     - job: configure-gcc-8-cuda-10.2
673       artifacts: true
674   except:
675     variables:
676       - $GROMACS_RELEASE
677
678 .build-clang:
679   extends:
680     - .build-extends-template
681
682 build-clang-6:
683   extends:
684     - .build-clang
685     - .use-clang6
686   needs:
687     - job: simple-build
688       artifacts: false
689     - job: configure-clang-6
690       artifacts: true
691   except:
692     variables:
693       - $GROMACS_RELEASE
694
695 build-clang-7:
696   extends:
697     - .build-clang
698     - .use-clang7
699   needs:
700     - job: simple-build
701       artifacts: false
702     - job: configure-clang-7
703       artifacts: true
704   except:
705     variables:
706       - $GROMACS_RELEASE
707
708 build-clang-7-release:
709   extends:
710     - .build-clang
711     - .use-clang7
712   stage: release-build
713   variables:
714     BUILD_DIR: release-builds-clang
715   needs:
716     - job: configure-clang-7-release
717       artifacts: true
718   only:
719     refs:
720       - web
721       - schedules
722       - triggers
723     variables:
724       - $GROMACS_RELEASE
725
726 build-clang-7-gmxapi:
727   extends:
728     - .build-clang
729     - .gmxapi-extra-installs
730     - .use-clang7
731   needs:
732     - job: simple-build
733       artifacts: false
734     - job: configure-clang-7-gmxapi
735       artifacts: true
736   except:
737     variables:
738       - $GROMACS_RELEASE
739
740 build-clang-7-gmxapi-release:
741   extends:
742     - .build-clang
743     - .gmxapi-extra-installs
744     - .use-clang7
745   stage: release-build
746   variables:
747     BUILD_DIR: release-builds-clang
748   needs:
749     - job: configure-clang-7-gmxapi-release
750       artifacts: true
751   only:
752     refs:
753       - web
754       - schedules
755       - triggers
756     variables:
757       - $GROMACS_RELEASE
758
759 build-clang-8:
760   extends:
761     - .build-clang
762     - .use-clang8
763   needs:
764     - job: simple-build
765       artifacts: false
766     - job: configure-clang-8
767       artifacts: true
768   except:
769     variables:
770       - $GROMACS_RELEASE
771
772 build-clang-8-release:
773   extends:
774     - .build-clang
775     - .use-clang8
776   stage: release-build
777   variables:
778     BUILD_DIR: release-builds-clang
779   needs:
780     - job: configure-clang-8-release
781       artifacts: true
782   only:
783     refs:
784       - web
785       - schedules
786       - triggers
787     variables:
788       - $GROMACS_RELEASE
789
790
791 # Jobs running during test stage
792 .test-script-template:
793   script:
794     - cd $BUILD_DIR
795     - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
796     - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
797       ctestLog.log | tee ctestErrors.log
798     - xsltproc scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
799     - if [ -s ctestErrors.log ] ; then
800       echo "Error during running ctest";
801       exit 1;
802       fi
803     - cd ..
804   artifacts:
805     reports:
806       junit: $BUILD_DIR/JUnitTestResults.xml
807     paths:
808       - $BUILD_DIR/Testing
809       - $BUILD_DIR/tests
810     when: always
811     expire_in: 1 week
812
813 .test-extends-template:
814   stage: test
815   retry:
816     max: 2
817   extends:
818     - .test-script-template
819     - .variables:default
820
821 .test-gcc-cuda:
822   extends:
823     - .test-extends-template
824     - .cuda-template
825
826 test-gcc-7:
827   extends:
828     - .test-extends-template
829     - .use-gcc7
830   needs:
831     - job: simple-build
832       artifacts: false
833     - job: build-gcc-7
834   except:
835     variables:
836       - $GROMACS_RELEASE
837
838 test-gcc-7-release:
839   extends:
840     - .test-extends-template
841     - .use-gcc7
842   stage: release-tests
843   variables:
844     BUILD_DIR: release-builds-gcc
845   needs:
846     - job: configure-gcc-7-release
847       artifacts: true
848     - job: build-gcc-7-release
849       artifacts: true
850   only:
851     refs:
852       - triggers
853       - web
854       - schedules
855     variables:
856       - $GROMACS_RELEASE
857
858 test-gcc-7-simd-sse41:
859   extends:
860     - .test-extends-template
861     - .use-gcc7
862   needs:
863     - job: simple-build
864       artifacts: false
865     - job: build-gcc-7-simd-sse41
866   except:
867     variables:
868       - $GROMACS_RELEASE
869
870 test-gcc-7-double:
871   extends:
872     - .test-extends-template
873     - .use-gcc7
874   needs:
875     - job: simple-build
876       artifacts: false
877     - job: build-gcc-7-double
878   except:
879     variables:
880       - $GROMACS_RELEASE
881
882 test-gcc-7-double-release:
883   extends:
884     - .test-extends-template
885     - .use-gcc7
886   stage: release-tests
887   variables:
888     BUILD_DIR: release-builds-gcc
889   needs:
890     - job: configure-gcc-7-double-release
891       artifacts: true
892     - job: build-gcc-7-double-release
893       artifacts: true
894   only:
895     refs:
896       - triggers
897       - web
898       - schedules
899     variables:
900       - $GROMACS_RELEASE
901
902 test-gcc-7-gmxapi:
903   extends:
904     - .test-extends-template
905     - .gmxapi-extra-installs
906     - .use-gcc7
907   needs:
908     - job: simple-build
909       artifacts: false
910     - job: build-gcc-7-gmxapi
911   except:
912     variables:
913       - $GROMACS_RELEASE
914
915 test-gcc-7-gmxapi-release:
916   extends:
917     - .test-extends-template
918     - .gmxapi-extra-installs
919     - .use-gcc7
920   stage: release-tests
921   variables:
922     BUILD_DIR: release-builds-gcc
923   needs:
924     - job: configure-gcc-7-gmxapi-release
925       artifacts: true
926     - job: build-gcc-7-gmxapi-release
927       artifacts: true
928   only:
929     refs:
930       - triggers
931       - web
932       - schedules
933     variables:
934       - $GROMACS_RELEASE
935
936 test-gcc-8:
937   extends:
938     - .test-extends-template
939     - .use-gcc8
940   needs:
941     - job: simple-build
942       artifacts: false
943     - job: build-gcc-8
944   except:
945     variables:
946       - $GROMACS_RELEASE
947
948 test-gcc-8-release:
949   extends:
950     - .test-extends-template
951     - .use-gcc8
952   stage: release-tests
953   variables:
954     BUILD_DIR: release-builds-gcc
955   needs:
956     - job: configure-gcc-8-release
957       artifacts: true
958     - job: build-gcc-8-release
959       artifacts: true
960   only:
961     refs:
962       - triggers
963       - web
964       - schedules
965     variables:
966       - $GROMACS_RELEASE
967
968 test-gcc-8-cuda-10.2:
969   variables:
970     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
971     KUBERNETES_EXTENDED_RESOURCE_LIMIT: 1
972   extends:
973     - .test-gcc-cuda
974     - .use-gcc8:cuda-10.2
975   needs:
976     - job: simple-build
977       artifacts: false
978     - job: build-gcc-8-cuda-10.2
979   except:
980     variables:
981       - $GROMACS_RELEASE
982
983 test-clang-6:
984   extends:
985     - .test-extends-template
986     - .use-clang6
987   needs:
988     - job: simple-build
989       artifacts: false
990     - job: build-clang-6
991   except:
992     variables:
993       - $GROMACS_RELEASE
994
995 test-clang-7:
996   extends:
997     - .test-extends-template
998     - .use-clang7
999   needs:
1000     - job: simple-build
1001       artifacts: false
1002     - job: build-clang-7
1003   except:
1004     variables:
1005       - $GROMACS_RELEASE
1006
1007 test-clang-7-release:
1008   extends:
1009     - .test-extends-template
1010     - .use-clang7
1011   stage: release-tests
1012   variables:
1013     BUILD_DIR: release-builds-clang
1014   needs:
1015     - job: configure-clang-7-release
1016       artifacts: true
1017     - job: build-clang-7-release
1018       artifacts: true
1019   only:
1020     refs:
1021       - triggers
1022       - web
1023       - schedules
1024     variables:
1025       - $GROMACS_RELEASE
1026
1027 test-clang-7-gmxapi:
1028   extends:
1029     - .test-extends-template
1030     - .gmxapi-extra-installs
1031     - .use-clang7
1032   needs:
1033     - job: simple-build
1034       artifacts: false
1035     - job: build-clang-7-gmxapi
1036   except:
1037     variables:
1038       - $GROMACS_RELEASE
1039
1040 test-clang-7-gmxapi-release:
1041   extends:
1042     - .test-extends-template
1043     - .gmxapi-extra-installs
1044     - .use-clang7
1045   stage: release-tests
1046   variables:
1047     BUILD_DIR: release-builds-clang
1048   needs:
1049     - job: configure-clang-7-gmxapi-release
1050       artifacts: true
1051     - job: build-clang-7-gmxapi-release
1052       artifacts: true
1053   only:
1054     refs:
1055       - triggers
1056       - web
1057       - schedules
1058     variables:
1059       - $GROMACS_RELEASE
1060
1061 test-clang-8:
1062   extends:
1063     - .test-extends-template
1064     - .use-clang8
1065   needs:
1066     - job: simple-build
1067       artifacts: false
1068     - job: build-clang-8
1069   except:
1070     variables:
1071       - $GROMACS_RELEASE
1072
1073 test-clang-8-release:
1074   extends:
1075     - .test-extends-template
1076     - .use-clang8
1077   stage: release-tests
1078   variables:
1079     BUILD_DIR: release-builds-clang
1080   needs:
1081     - job: configure-clang-8-release
1082       artifacts: true
1083     - job: build-clang-8-release
1084       artifacts: true
1085   only:
1086     refs:
1087       - triggers
1088       - web
1089       - schedules
1090     variables:
1091       - $GROMACS_RELEASE