xref: /petsc/.gitlab-ci.yml (revision 5e28bcb6eb89755d887ff19df10fe7e2cb7942ae)
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    - make CFLAGS=${MAKE_CFLAGS} CXXFLAGS=${MAKE_CXXFLAGS} cleantest allgtests-tap TIMEOUT=${TIMEOUT}
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  after_script:
175    - date
176    - ccache --show-stats
177
178.linux_test:
179  extends: .linux_test_noflags
180  variables:
181    MAKE_CFLAGS: -Werror
182    MAKE_CXXFLAGS: -Werror
183
184.freebsd_test:
185  variables:
186    MAKE_CFLAGS: -Werror
187    MAKE_CXXFLAGS: -Werror
188  before_script:
189    - date
190    - hostname
191    - freebsd-version
192    - echo $(sysctl -n hw.ncpu)
193    - ccache --zero-stats
194  after_script:
195    - date
196    - ccache --show-stats
197
198.osx_test:
199  variables:
200    MAKE_CFLAGS: -Werror
201    MAKE_CXXFLAGS: -Werror
202  before_script:
203    - date
204    - hostname
205    - sw_vers -productVersion
206    - echo $(sysctl -n hw.ncpu)
207    - ccache --zero-stats
208  after_script:
209    - date
210    - ccache --show-stats
211
212.opensolaris_test:
213  before_script:
214    - date
215    - hostname
216    - uname -a
217    - echo $(nproc)
218  after_script:
219    - date
220
221.mswin_test:
222  before_script:
223    - date
224    - hostname
225    - uname -a
226    - echo $(nproc)
227  after_script:
228    - date
229
230#
231# The following tests run as part of stage-2.
232#
233# The tags variable used in the tests below connects the particular test with the runners
234# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
235# For example the test linux-gcc-complex-opt  any runner that has the tag 'name:pj02'
236# (in a blue box beneath it)
237#
238
239linux-gcc-complex-opt:
240  extends:
241    - .stage-2
242    - .linux_test
243  tags:
244    - linux-dell
245  variables:
246    TEST_ARCH: arch-ci-linux-gcc-complex-opt
247
248linux-gcc-pkgs-opt:
249  extends:
250    - .stage-2
251    - .linux_test
252  tags:
253    - linux-dell
254  variables:
255    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
256
257linux-gcc-quad-64idx-dbg:
258  extends:
259    - .stage-2
260    - .linux_test
261  tags:
262    - linux-dell
263  variables:
264    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
265
266linux-cuda-double:
267  extends:
268    - .stage-2
269    - .linux_test
270  tags:
271    - gpu:nvidia, os:linux
272  variables:
273    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
274    TEST_ARCH: arch-ci-linux-cuda-double
275
276freebsd-c-single-opt:
277  extends:
278    - .stage-2
279    - .freebsd_test
280  tags:
281    - os:fbsd
282  variables:
283    TEST_ARCH: arch-ci-freebsd-c-single-opt
284
285freebsd-cxx-cmplx-64idx-dbg:
286  extends:
287    - .stage-2
288    - .freebsd_test
289  tags:
290    - os:fbsd
291  variables:
292    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
293
294opensolaris-misc:
295  extends:
296    - .stage-3
297    - .opensolaris_test
298  tags:
299    - name:n-gage
300  variables:
301    TEST_ARCH: arch-ci-opensolaris-misc
302
303osx-cxx-pkgs-opt:
304  extends:
305    - .stage-3
306    - .osx_test
307  tags:
308    - os:macos
309  variables:
310    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
311    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
312
313mswin-uni:
314  extends:
315    - .stage-2
316    - .mswin_test
317  tags:
318    - name:ps5-2
319  variables:
320    TEST_ARCH: arch-ci-mswin-uni
321
322#
323# The following tests run as part of stage-3.
324#
325
326mswin-intel-cxx-cmplx:
327  extends:
328    - .stage-3
329    - .mswin_test
330  tags:
331    - name:ps5
332  variables:
333    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
334
335mswin-intel:
336  extends:
337    - .stage-3
338    - .mswin_test
339  tags:
340    - name:ps5
341  variables:
342    TEST_ARCH: arch-ci-mswin-intel
343
344mswin-opt-impi:
345  extends:
346    - .stage-3
347    - .mswin_test
348  tags:
349    - name:ps4
350  variables:
351    TEST_ARCH: arch-ci-mswin-opt-impi
352
353opensolaris-cmplx-pkgs-dbg:
354  extends:
355    - .stage-3
356    - .opensolaris_test
357  tags:
358    - name:n-gage
359  variables:
360    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
361
362opensolaris-pkgs-opt:
363  extends:
364    - .stage-3
365    - .opensolaris_test
366  tags:
367    - name:n-gage
368  variables:
369    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
370
371freebsd-pkgs-opt:
372  extends:
373    - .stage-3
374    - .freebsd_test
375  tags:
376    - os:fbsd
377  variables:
378    TEST_ARCH: arch-ci-freebsd-pkgs-opt
379
380freebsd-cxx-cmplx-pkgs-dbg:
381  extends:
382    - .stage-3
383    - .freebsd_test
384  tags:
385    - os:fbsd
386  variables:
387    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
388
389freebsd-cxx-pkgs-opt:
390  extends:
391    - .stage-3
392    - .freebsd_test
393  tags:
394    - os:fbsd
395  variables:
396    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
397    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
398
399osx-cxx-cmplx-pkgs-dbg:
400  extends:
401    - .stage-3
402    - .osx_test
403  tags:
404    - os:macos
405  variables:
406    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
407
408osx-dbg:
409  extends:
410    - .stage-3
411    - .osx_test
412  tags:
413    - os:macos
414  variables:
415    TEST_ARCH: arch-ci-osx-dbg
416
417osx-xsdk-opt:
418  extends:
419    - .stage-3
420    - .osx_test
421  tags:
422    - os:macos
423  variables:
424    TEST_ARCH: arch-ci-osx-xsdk-opt
425
426linux-cmplx-gcov:
427  extends:
428    - .stage-3
429    - .linux_test
430  tags:
431    - mcs-nfs
432  variables:
433    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -vecscatter_mpi1 false -options_left false
434    TEST_ARCH: arch-ci-linux-cmplx-gcov
435  after_script:
436    - make gcov
437  artifacts:
438    when: always
439    paths:
440    - ${TEST_ARCH}/lib/petsc/conf/*.log
441    - ${TEST_ARCH}/tests/testresults.xml
442    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
443    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
444    - ${TEST_ARCH}/gcov.tar.gz
445    expire_in: 4 days
446
447
448linux-cmplx-single:
449  extends:
450    - .stage-3
451    - .linux_test
452  tags:
453    - name:si
454  variables:
455    TEST_ARCH: arch-ci-linux-cmplx-single
456
457linux-without-fc:
458  extends:
459    - .stage-3
460    - .linux_test
461  tags:
462    - name:si
463  variables:
464    TEST_ARCH: arch-ci-linux-without-fc
465
466linux-clang-avx:
467  extends:
468    - .stage-3
469    - .linux_test
470  tags:
471    - name:isdp001
472  variables:
473    TEST_ARCH: arch-ci-linux-clang-avx
474
475linux-gcc-cxx-avx2:
476  extends:
477    - .stage-3
478    - .linux_test
479  tags:
480    - name:isdp001
481  variables:
482    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
483
484linux-knl:
485  extends:
486    - .stage-3
487    - .linux_test
488  tags:
489    - name:isdp001
490  variables:
491    TEST_ARCH: arch-ci-linux-knl
492
493linux-c-exodus-dbg:
494  extends:
495    - .stage-3
496    - .linux_test
497  tags:
498    - gpu:nvidia, os:linux
499  variables:
500    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
501    TEST_ARCH: arch-ci-linux-c-exodus-dbg
502
503linux-cuda-single:
504  extends:
505    - .stage-3
506    - .linux_test
507  tags:
508    - gpu:nvidia, os:linux
509  variables:
510    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -cuda_initialize 0
511    TEST_ARCH: arch-ci-linux-cuda-single
512
513linux-viennacl:
514  extends:
515    - .stage-3
516    - .linux_test
517  tags:
518    - gpu:nvidia, os:linux, name:frog
519  variables:
520    TEST_ARCH: arch-ci-linux-viennacl
521
522linux-opt-misc:
523  extends:
524    - .stage-3
525    - .linux_test
526  tags:
527    - name:compute004
528  variables:
529    TEST_ARCH: arch-ci-linux-opt-misc
530
531linux-pkgs-cxx-mlib:
532  extends:
533    - .stage-3
534    - .linux_test
535  tags:
536    - name:pj02
537  variables:
538    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent
539    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
540
541linux-cxx-cmplx-pkgs-64idx:
542  extends:
543    - .stage-3
544    - .linux_test
545  tags:
546    - name:pj01
547  variables:
548    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
549
550linux-pkgs-dbg-ftn-interfaces:
551  extends:
552    - .stage-3
553    - .linux_test
554  tags:
555    - name:pj02
556  variables:
557    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
558
559linux-analyzer:
560  extends:
561    - .stage-3
562    - .linux_test
563  tags:
564    - mcs-nfs
565  variables:
566    TEST_ARCH: arch-ci-linux-analyzer
567
568linux-gcc-ifc-cmplx:
569  extends:
570    - .stage-3
571    - .linux_test
572  tags:
573    - mcs-nfs
574  variables:
575    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
576
577linux-gcov:
578  extends:
579    - .stage-3
580    - .linux_test
581  tags:
582    - mcs-nfs
583  variables:
584    TEST_ARCH: arch-ci-linux-gcov
585  after_script:
586    - make gcov
587  artifacts:
588    when: always
589    paths:
590    - ${TEST_ARCH}/lib/petsc/conf/*.log
591    - ${TEST_ARCH}/tests/testresults.xml
592    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
593    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
594    - ${TEST_ARCH}/gcov.tar.gz
595    expire_in: 4 days
596
597
598linux-ILP64:
599  extends:
600    - .stage-3
601    - .linux_test
602  tags:
603    - name:compute004
604  variables:
605    TEST_ARCH: arch-ci-linux-ILP64
606
607linux-matlab-ilp64-gcov:
608  extends:
609    - .stage-3
610    - .linux_test
611  tags:
612    - mcs-nfs
613  variables:
614    TEST_ARCH: arch-ci-linux-matlab-ilp64-gcov
615  after_script:
616    - make gcov
617  artifacts:
618    when: always
619    paths:
620    - ${TEST_ARCH}/lib/petsc/conf/*.log
621    - ${TEST_ARCH}/tests/testresults.xml
622    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
623    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
624    - ${TEST_ARCH}/gcov.tar.gz
625    expire_in: 4 days
626
627
628linux-opt-cxx-quad:
629  extends:
630    - .stage-3
631    - .linux_test
632  tags:
633    - mcs-nfs
634  variables:
635    TEST_ARCH: arch-ci-linux-opt-cxx-quad
636
637linux-pgi:
638  extends:
639    - .stage-3
640    - .linux_test_noflags
641  tags:
642    - mcs-nfs,name:petsc
643  variables:
644    TEST_ARCH: arch-ci-linux-pgi
645
646linux-pkgs-64idx:
647  extends:
648    - .stage-3
649    - .linux_test
650  tags:
651    - mcs-nfs
652  variables:
653    TEST_ARCH: arch-ci-linux-pkgs-64idx
654
655linux-pkgs-gcov:
656  extends:
657    - .stage-3
658    - .linux_test
659  tags:
660    - mcs-nfs
661  variables:
662    TEST_ARCH: arch-ci-linux-pkgs-gcov
663  after_script:
664    - make gcov
665  artifacts:
666    when: always
667    paths:
668    - ${TEST_ARCH}/lib/petsc/conf/*.log
669    - ${TEST_ARCH}/tests/testresults.xml
670    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
671    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
672    - ${TEST_ARCH}/gcov.tar.gz
673    expire_in: 4 days
674
675linux-pkgs-opt:
676  extends:
677    - .stage-3
678    - .linux_test
679  tags:
680    - name:compute004
681  variables:
682    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump -saws_port_auto_select -saws_port_auto_select_silent
683    TEST_ARCH: arch-ci-linux-pkgs-opt
684
685linux-pkgs-valgrind:
686  extends:
687    - .stage-3
688    - .linux_test
689  tags:
690    - valgrind
691  variables:
692    TEST_ARCH: arch-ci-linux-pkgs-valgrind
693    TIMEOUT: 7200
694
695linux-xsdk-dbg:
696  extends:
697    - .stage-3
698    - .linux_test
699  tags:
700    - mcs-nfs
701  variables:
702    TEST_ARCH: arch-ci-linux-xsdk-dbg
703
704linux-pardiso:
705  extends:
706    - .stage-3
707    - .linux_test
708  tags:
709    - mcs-nfs
710  variables:
711    TEST_ARCH: arch-ci-linux-pardiso
712
713linux-nagfor:
714  extends:
715    - .stage-3
716    - .linux_test
717  tags:
718    - mcs-nfs
719  variables:
720    TEST_ARCH: arch-ci-linux-nagfor
721
722# job for analyzing the final coverage results
723analyze-pipeline:
724  stage: .post
725  image: jedbrown/mpich-ccache
726  variables:
727    PYTHON: python3
728    # Need a dummy TEST_ARCH that comes from artifacts
729    TEST_ARCH: arch-ci-linux-pkgs-gcov
730  only:
731    refs:
732#     Set with CI/CD Shedules - New Schedule
733      - schedules
734#     Set with CI/CD Pipelines - Run Pipeline
735      - web
736  allow_failure: true
737  before_script:
738    - date
739  script:
740  - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
741#  - make mergegcov LOC=$PWD
742  - ${PYTHON} lib/petsc/bin/maint/gcov.py --merge_gcov --loc=${PWD} --petsc_arch ${TEST_ARCH}
743  - ls
744  - ls arch*/*
745  artifacts:
746    name: "$CI_JOB_NAME"
747    when: always
748    paths:
749    - i*.html
750    - arch-*-gcov/*
751    expire_in: 4 days
752#
753#
754# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
755# that fail produce a warning, but do not block execution of a pipeline.
756#
757
758.test-experimental:
759  extends: .test
760  allow_failure: true
761
762