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