xref: /petsc/.gitlab-ci.yml (revision ef5b78c99a84f41e3ac552ef2ff42f4a3cb13cb0)
1#
2# stage-1 take only a few minutes and generally run on the cloud; they do not run the full test suite or external packages.
3#
4# stage-2 runs on MCS systems and may take 10 to 15 minutes. They run the full test suite but with limited mixture of external packages
5#
6# stage-3 runs on MCS systems and may take an hour or more. They run the full test suite and heavily test external packages, utilize valgrind etc
7#         (not yet implemented)
8#
9# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
10#   You can limit the testing by using the variable STAGE with value 1 or 2
11#
12# By default the test branch is merged to master before testing. (not yet implemented)
13#   You can limite this by using the variable MERGETOMASTER with value 0 (not yet implemented)
14#
15
16stages:
17  - stage-1
18  - stage-2
19  - stage-3
20variables:
21  GIT_STRATEGY: fetch
22  GIT_CLEAN_FLAGS: -ffdxq
23  PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
24  TIMEOUT: 600
25
26#
27# The most basic template that most tests will expand upon. In particular merge requests and branch pushes DO NOT trigger testing
28#
29
30.test:
31  only:
32    refs:
33#     Set with CI/CD Shedules - New Schedule
34      - schedules
35#     Set with CI/CD Pipelines - Run Pipeline
36      - web
37  dependencies: []
38
39#
40#  This provides the basic order of operations and options template for cloud based stage 1 tests.
41#  Not all test-short need to follow this template but most will.
42#
43
44.stage-1:
45  extends: .test
46  stage: stage-1
47  image: jedbrown/mpich-ccache
48  tags:
49    - docker
50  before_script:
51    - date
52    - echo nproc=$(nproc)
53    - cat /proc/cpuinfo
54    - export CCACHE_COMPILERCHECK=content
55    - export CCACHE_DIR=$(pwd)/.ccache
56    - ccache --show-stats
57    - ccache --zero-stats
58    - echo CONFIG_OPTS=$(CONFIG_OPTS)
59  script:
60    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
61    - make CFLAGS=-Werror CXXFLAGS=-Werror
62    - make CFLAGS=-Werror CXXFLAGS=-Werror allgtests-tap search="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
63  after_script:
64    - date
65    - CCACHE_DIR=$(pwd)/.ccache ccache --show-stats
66  artifacts:
67    reports:
68      junit: arch-*/tests/testresults.xml
69    name: "$CI_JOB_NAME"
70    when: always
71    paths:
72    - arch-*/lib/petsc/conf/*.log
73    - arch-*/tests/testresults.xml
74    - arch-*/tests/test_*_tap.log
75    - arch-*/tests/test_*_err.log
76    expire_in: 4 days
77  cache:
78    paths:
79      - .ccache/
80    key: "${CI_JOB_NAME}"
81
82#
83# The following tests run on the cloud as part of stage-1.
84#
85
86mpich-cxx-py3:
87  extends: .stage-1
88  variables:
89    PYTHON: python3
90    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-clanguage=cxx --with-fc=0
91    TEST_SEARCH: snes_tutorials-ex48%
92
93uni-complex-float-int64:
94  extends: .stage-1
95  variables:
96    PYTHON: python3
97    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
98    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
99
100c89-mlib-static-py2:
101  extends: .stage-1
102  image: jedbrown/mpich-ccache:python2
103  variables:
104    PYTHON: python2
105    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-single-library=0 --with-shared-libraries=0 CFLAGS=-std=c89
106    TEST_SEARCH: snes_tutorials-ex19%
107
108checksource:
109  extends: .test
110  image: jedbrown/mpich-ccache
111  stage: stage-1
112  script:
113    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
114    - make checkbadSource SHELL=bash
115    - make check_output SHELL=bash
116
117#
118# This provides the basic order of operations and options template for stage-2,3 tests.
119# Not all stage-2,3 need to follow this template, but most will.
120#
121.stage-23:
122  extends: .test
123  script:
124    - printf "PATH:$PATH\n"
125    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
126    - printf "./config/examples/${TEST_ARCH}.py\n"
127    - cat ./config/examples/${TEST_ARCH}.py
128    - ./config/examples/${TEST_ARCH}.py
129    - make CFLAGS=${MAKE_CFLAGS} CXXFLAGS=${MAKE_CXXFLAGS}
130    - make CFLAGS=${MAKE_CFLAGS} CXXFLAGS=${MAKE_CXXFLAGS} check
131    - make updatedatafiles
132    - if [ -z ${DISABLE_TESTS+x} ]; then make CFLAGS=${MAKE_CFLAGS} CXXFLAGS=${MAKE_CXXFLAGS} cleantest allgtests-tap TIMEOUT=${TIMEOUT}; fi
133  artifacts:
134    reports:
135      junit: ${TEST_ARCH}/tests/testresults.xml
136    name: "$CI_JOB_NAME"
137    when: always
138    paths:
139    - ${TEST_ARCH}/lib/petsc/conf/*.log
140    - ${TEST_ARCH}/tests/testresults.xml
141    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
142    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
143    expire_in: 4 days
144  variables:
145    OPENBLAS_NUM_THREADS: 1
146
147.stage-2:
148  extends: .stage-23
149  stage: stage-2
150  only:
151    variables:
152      - $STAGE != "1"
153      - $STAGE != "3"
154
155.stage-3:
156  extends: .stage-23
157  stage: stage-3
158  only:
159    variables:
160      - $STAGE != "1"
161      - $STAGE != "2"
162
163#
164# The following provide templates for various OSes for pre/post info
165#
166
167.linux_test_noflags:
168  before_script:
169    - date
170    - hostname
171    - grep PRETTY_NAME /etc/os-release
172    - echo $(nproc)
173    - ccache --zero-stats
174    - if [ ! -z ${LOAD_MODULES+x} ]; then module load ${LOAD_MODULES}; module list; fi
175  after_script:
176    - date
177    - ccache --show-stats
178
179.linux_test:
180  extends: .linux_test_noflags
181  variables:
182    MAKE_CFLAGS: -Werror
183    MAKE_CXXFLAGS: -Werror
184
185.freebsd_test:
186  variables:
187    MAKE_CFLAGS: -Werror
188    MAKE_CXXFLAGS: -Werror
189  before_script:
190    - date
191    - hostname
192    - freebsd-version
193    - echo $(sysctl -n hw.ncpu)
194    - ccache --zero-stats
195  after_script:
196    - date
197    - ccache --show-stats
198
199.osx_test:
200  variables:
201    MAKE_CFLAGS: -Werror
202    MAKE_CXXFLAGS: -Werror
203  before_script:
204    - date
205    - hostname
206    - sw_vers -productVersion
207    - echo $(sysctl -n hw.ncpu)
208    - ccache --zero-stats
209  after_script:
210    - date
211    - ccache --show-stats
212
213.opensolaris_test:
214  before_script:
215    - date
216    - hostname
217    - uname -a
218    - echo $(nproc)
219  after_script:
220    - date
221
222.mswin_test:
223  before_script:
224    - date
225    - hostname
226    - uname -a
227    - echo $(nproc)
228  after_script:
229    - date
230
231#
232# The following tests run as part of stage-2.
233#
234# The tags variable used in the tests below connects the particular test with the runners
235# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
236# For example the test linux-gcc-complex-opt  any runner that has the tag 'name:pj02'
237# (in a blue box beneath it)
238#
239
240linux-gcc-complex-opt:
241  extends:
242    - .stage-2
243    - .linux_test
244  tags:
245    - linux-dell
246  variables:
247    TEST_ARCH: arch-ci-linux-gcc-complex-opt
248
249linux-gcc-pkgs-opt:
250  extends:
251    - .stage-2
252    - .linux_test
253  tags:
254    - linux-dell
255  variables:
256    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
257
258linux-gcc-quad-64idx-dbg:
259  extends:
260    - .stage-2
261    - .linux_test
262  tags:
263    - linux-dell
264  variables:
265    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
266
267linux-cuda-double:
268  extends:
269    - .stage-2
270    - .linux_test
271  tags:
272    - gpu:nvidia, os:linux, name:p1
273  variables:
274    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
275    TEST_ARCH: arch-ci-linux-cuda-double
276
277freebsd-c-single-opt:
278  extends:
279    - .stage-2
280    - .freebsd_test
281  tags:
282    - os:fbsd
283  variables:
284    TEST_ARCH: arch-ci-freebsd-c-single-opt
285
286freebsd-cxx-cmplx-64idx-dbg:
287  extends:
288    - .stage-2
289    - .freebsd_test
290  tags:
291    - os:fbsd
292  variables:
293    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
294
295opensolaris-misc:
296  extends:
297    - .stage-3
298    - .opensolaris_test
299  tags:
300    - name:n-gage
301  variables:
302    TEST_ARCH: arch-ci-opensolaris-misc
303
304osx-cxx-pkgs-opt:
305  extends:
306    - .stage-3
307    - .osx_test
308  tags:
309    - os:macos
310  variables:
311    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
312    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
313
314mswin-uni:
315  extends:
316    - .stage-2
317    - .mswin_test
318  tags:
319    - name:ps5-2
320  variables:
321    TEST_ARCH: arch-ci-mswin-uni
322
323mswin-gnu:
324  extends:
325    - .stage-2
326    - .mswin_test
327  tags:
328    - name:ps5-3
329  variables:
330    TEST_ARCH: arch-ci-mswin-gnu
331    MAKE_CFLAGS: -Werror
332    MAKE_CXXFLAGS: -Werror
333    DISABLE_TESTS: 1
334  artifacts:
335    reports:
336    paths:
337    - arch-*/lib/petsc/conf/*.log
338    expire_in: 4 days
339
340#
341# The following tests run as part of stage-3.
342#
343
344mswin-intel-cxx-cmplx:
345  extends:
346    - .stage-3
347    - .mswin_test
348  tags:
349    - name:ps5
350  variables:
351    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
352
353mswin-intel:
354  extends:
355    - .stage-3
356    - .mswin_test
357  tags:
358    - name:ps5
359  variables:
360    TEST_ARCH: arch-ci-mswin-intel
361
362mswin-opt-impi:
363  extends:
364    - .stage-3
365    - .mswin_test
366  tags:
367    - name:ps4
368  variables:
369    TEST_ARCH: arch-ci-mswin-opt-impi
370
371opensolaris-cmplx-pkgs-dbg:
372  extends:
373    - .stage-3
374    - .opensolaris_test
375  tags:
376    - name:n-gage
377  variables:
378    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
379
380opensolaris-pkgs-opt:
381  extends:
382    - .stage-3
383    - .opensolaris_test
384  tags:
385    - name:n-gage
386  variables:
387    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
388
389freebsd-pkgs-opt:
390  extends:
391    - .stage-3
392    - .freebsd_test
393  tags:
394    - os:fbsd
395  variables:
396    TEST_ARCH: arch-ci-freebsd-pkgs-opt
397
398freebsd-cxx-cmplx-pkgs-dbg:
399  extends:
400    - .stage-3
401    - .freebsd_test
402  tags:
403    - os:fbsd
404  variables:
405    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
406
407freebsd-cxx-pkgs-opt:
408  extends:
409    - .stage-3
410    - .freebsd_test
411  tags:
412    - os:fbsd
413  variables:
414    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
415    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
416
417osx-cxx-cmplx-pkgs-dbg:
418  extends:
419    - .stage-3
420    - .osx_test
421  tags:
422    - os:macos
423  variables:
424    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
425
426osx-dbg:
427  extends:
428    - .stage-3
429    - .osx_test
430  tags:
431    - os:macos
432  variables:
433    TEST_ARCH: arch-ci-osx-dbg
434
435osx-xsdk-opt:
436  extends:
437    - .stage-3
438    - .osx_test
439  tags:
440    - os:macos
441  variables:
442    TEST_ARCH: arch-ci-osx-xsdk-opt
443
444linux-cmplx-gcov:
445  extends:
446    - .stage-3
447    - .linux_test
448  tags:
449    - mcs-nfs
450  variables:
451    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -vecscatter_mpi1 false -options_left false
452    TEST_ARCH: arch-ci-linux-cmplx-gcov
453  after_script:
454    - make gcov
455  artifacts:
456    when: always
457    paths:
458    - ${TEST_ARCH}/lib/petsc/conf/*.log
459    - ${TEST_ARCH}/tests/testresults.xml
460    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
461    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
462    - ${TEST_ARCH}/gcov.tar.gz
463    expire_in: 4 days
464
465
466linux-cmplx-single:
467  extends:
468    - .stage-3
469    - .linux_test
470  tags:
471    - name:si
472  variables:
473    TEST_ARCH: arch-ci-linux-cmplx-single
474
475linux-without-fc:
476  extends:
477    - .stage-3
478    - .linux_test
479  tags:
480    - name:si
481  variables:
482    TEST_ARCH: arch-ci-linux-without-fc
483
484linux-clang-avx:
485  extends:
486    - .stage-3
487    - .linux_test
488  tags:
489    - name:isdp001
490  variables:
491    TEST_ARCH: arch-ci-linux-clang-avx
492
493linux-gcc-cxx-avx2:
494  extends:
495    - .stage-3
496    - .linux_test
497  tags:
498    - name:isdp001
499  variables:
500    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
501
502linux-knl:
503  extends:
504    - .stage-3
505    - .linux_test
506  tags:
507    - name:isdp001
508  variables:
509    TEST_ARCH: arch-ci-linux-knl
510
511linux-c-exodus-dbg:
512  extends:
513    - .stage-3
514    - .linux_test
515  tags:
516    - gpu:nvidia, os:linux
517  variables:
518    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
519    TEST_ARCH: arch-ci-linux-c-exodus-dbg
520
521linux-cuda-single:
522  extends:
523    - .stage-3
524    - .linux_test
525  tags:
526    - gpu:nvidia, os:linux
527  variables:
528    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
529    TEST_ARCH: arch-ci-linux-cuda-single
530
531linux-viennacl:
532  extends:
533    - .stage-3
534    - .linux_test
535  tags:
536    - gpu:nvidia, os:linux, name:frog
537  variables:
538    TEST_ARCH: arch-ci-linux-viennacl
539
540linux-opt-misc:
541  extends:
542    - .stage-3
543    - .linux_test
544  tags:
545    - gce-nfs
546  variables:
547    TEST_ARCH: arch-ci-linux-opt-misc
548
549linux-pkgs-cxx-mlib:
550  extends:
551    - .stage-3
552    - .linux_test
553  tags:
554    - name:pj02
555  variables:
556    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent
557    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
558
559linux-cxx-cmplx-pkgs-64idx:
560  extends:
561    - .stage-3
562    - .linux_test
563  tags:
564    - name:pj01
565  variables:
566    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
567
568linux-pkgs-dbg-ftn-interfaces:
569  extends:
570    - .stage-3
571    - .linux_test
572  tags:
573    - name:pj02
574  variables:
575    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
576
577linux-analyzer:
578  extends:
579    - .stage-3
580    - .linux_test
581  tags:
582    - mcs-nfs
583  variables:
584    TEST_ARCH: arch-ci-linux-analyzer
585
586linux-gcc-ifc-cmplx:
587  extends:
588    - .stage-3
589    - .linux_test
590  tags:
591    - mcs-nfs
592  variables:
593    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
594
595linux-gcov:
596  extends:
597    - .stage-3
598    - .linux_test
599  tags:
600    - mcs-nfs
601  variables:
602    TEST_ARCH: arch-ci-linux-gcov
603  after_script:
604    - make gcov
605  artifacts:
606    when: always
607    paths:
608    - ${TEST_ARCH}/lib/petsc/conf/*.log
609    - ${TEST_ARCH}/tests/testresults.xml
610    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
611    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
612    - ${TEST_ARCH}/gcov.tar.gz
613    expire_in: 4 days
614
615
616linux-ILP64:
617  extends:
618    - .stage-3
619    - .linux_test
620  tags:
621    - gce-nfs
622  variables:
623    TEST_ARCH: arch-ci-linux-ILP64
624
625linux-matlab-ilp64-gcov:
626  extends:
627    - .stage-3
628    - .linux_test
629  tags:
630    - mcs-nfs
631  variables:
632    TEST_ARCH: arch-ci-linux-matlab-ilp64-gcov
633  after_script:
634    - make gcov
635  artifacts:
636    when: always
637    paths:
638    - ${TEST_ARCH}/lib/petsc/conf/*.log
639    - ${TEST_ARCH}/tests/testresults.xml
640    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
641    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
642    - ${TEST_ARCH}/gcov.tar.gz
643    expire_in: 4 days
644
645
646linux-opt-cxx-quad:
647  extends:
648    - .stage-3
649    - .linux_test
650  tags:
651    - mcs-nfs
652  variables:
653    TEST_ARCH: arch-ci-linux-opt-cxx-quad
654
655linux-pgi:
656  extends:
657    - .stage-3
658    - .linux_test_noflags
659  tags:
660    - mcs-nfs,name:petsc
661  variables:
662    TEST_ARCH: arch-ci-linux-pgi
663
664linux-pkgs-64idx:
665  extends:
666    - .stage-3
667    - .linux_test
668  tags:
669    - mcs-nfs
670  variables:
671    TEST_ARCH: arch-ci-linux-pkgs-64idx
672
673linux-pkgs-gcov:
674  extends:
675    - .stage-3
676    - .linux_test
677  tags:
678    - mcs-nfs
679  variables:
680    TEST_ARCH: arch-ci-linux-pkgs-gcov
681  after_script:
682    - make gcov
683  artifacts:
684    when: always
685    paths:
686    - ${TEST_ARCH}/lib/petsc/conf/*.log
687    - ${TEST_ARCH}/tests/testresults.xml
688    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
689    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
690    - ${TEST_ARCH}/gcov.tar.gz
691    expire_in: 4 days
692
693linux-pkgs-opt:
694  extends:
695    - .stage-3
696    - .linux_test
697  tags:
698    - gce-nfs
699  variables:
700    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent
701    TEST_ARCH: arch-ci-linux-pkgs-opt
702
703linux-pkgs-valgrind:
704  extends:
705    - .stage-3
706    - .linux_test
707  tags:
708    - valgrind
709  variables:
710    TEST_ARCH: arch-ci-linux-pkgs-valgrind
711    TIMEOUT: 7200
712
713linux-xsdk-dbg:
714  extends:
715    - .stage-3
716    - .linux_test
717  tags:
718    - mcs-nfs
719  variables:
720    TEST_ARCH: arch-ci-linux-xsdk-dbg
721
722linux-intel:
723  extends:
724    - .stage-3
725    - .linux_test_noflags
726  tags:
727    - gce-nfs
728  variables:
729    TEST_ARCH: arch-ci-linux-intel
730    LOAD_MODULES: intel-mkl/19.5 intel/19.0
731
732linux-intel-cmplx:
733  extends:
734    - .stage-3
735    - .linux_test_noflags
736  tags:
737    - gce-nfs
738  variables:
739    TEST_ARCH: arch-ci-linux-intel-cmplx
740    LOAD_MODULES: intel-mkl/19.5 intel/19.0
741
742linux-nagfor:
743  extends:
744    - .stage-3
745    - .linux_test
746  tags:
747    - mcs-nfs
748  variables:
749    TEST_ARCH: arch-ci-linux-nagfor
750
751# job for analyzing the final coverage results
752analyze-pipeline:
753  stage: .post
754  image: jedbrown/mpich-ccache
755  variables:
756    PYTHON: python3
757    # Need a dummy TEST_ARCH that comes from artifacts
758    TEST_ARCH: arch-ci-linux-pkgs-gcov
759  only:
760    refs:
761#     Set with CI/CD Shedules - New Schedule
762      - schedules
763#     Set with CI/CD Pipelines - Run Pipeline
764      - web
765  allow_failure: true
766  before_script:
767    - date
768  script:
769  - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
770#  - make mergegcov LOC=$PWD
771  - ${PYTHON} lib/petsc/bin/maint/gcov.py --merge_gcov --loc=${PWD} --petsc_arch ${TEST_ARCH}
772  - ls
773  - ls arch*/*
774  artifacts:
775    name: "$CI_JOB_NAME"
776    when: always
777    paths:
778    - i*.html
779    - arch-*-gcov/*
780    expire_in: 4 days
781#
782#
783# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
784# that fail produce a warning, but do not block execution of a pipeline.
785#
786
787.test-experimental:
788  extends: .test
789  allow_failure: true
790
791