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