xref: /petsc/.gitlab-ci.yml (revision daa037dfd3c3bec8dc8659548d2b20b07c1dc6de)
1#
2# stage-1 take only a few minutes; 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#
8# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
9#   You can limit the testing by using the variable STAGE with value 1 or 2
10#
11
12stages:
13  - stage-1
14  - stage-2
15  - stage-3
16variables:
17  GIT_STRATEGY: fetch
18  GIT_CLEAN_FLAGS: -ffdxq
19  PETSC_OPTIONS: -checkstack
20  TIMEOUT: 450
21
22#
23# The most basic template that most tests will expand upon
24#
25
26.test-basic:
27  interruptible: true
28  only:
29    refs:
30#     Set with CI/CD Shedules - New Schedule
31      - schedules
32      - api
33#     Set with CI/CD Pipelines - Run Pipeline
34      - web
35      - merge_requests
36  dependencies: []
37
38.test:
39  extends: .test-basic
40  except:
41    variables:
42      # Skip if the docs-only label is attached to a merge request
43      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)docs-only($|,)/
44      - $PETSC_CI_SCHEDULED =~ /yes/
45
46check-ci-settings:
47  extends: .test-basic
48  stage: .pre
49  tags:
50    - gce-stage1
51  script:
52    - lib/petsc/bin/maint/check-ci-settings.sh
53#
54#  This provides the basic order of operations and options template for cloud based stage 1 tests.
55#  Not all test-short need to follow this template but most will.
56#
57
58.stage-1:
59  extends: .test
60  stage: stage-1
61  tags:
62    - gce-stage1
63  before_script:
64    - date
65    - hostname
66    - grep PRETTY_NAME /etc/os-release
67    - nproc
68    - lscpu
69    - ccache --zero-stats
70    - echo ${CONFIG_OPTS}
71  script:
72    - printf "PATH:$PATH\n"
73    - printf "PYTHONPATH:$PYTHONPATH\n"
74    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
75    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
76    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
77    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
78    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
79  variables:
80    MAKE_CFLAGS: -Werror
81    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
82    MAKE_FFLAGS: -Werror
83    MAKE_TEST_CFLAGS: -Werror
84    MAKE_TEST_CXXFLAGS: -Werror
85    MAKE_TEST_FFLAGS: -Werror
86  after_script:
87    - date
88    - ccache --show-stats
89  artifacts:
90    reports:
91      junit: arch-*/tests/testresults.xml
92    name: "$CI_JOB_NAME"
93    when: always
94    paths:
95    - arch-*/lib/petsc/conf/*.log
96    - arch-*/lib/pkgconfig/petsc.pc
97    - arch-*/tests/testresults.xml
98    - arch-*/tests/test_*_tap.log
99    - arch-*/tests/test_*_err.log
100    expire_in: 4 days
101
102#
103# The following tests run on the cloud as part of stage-1.
104#
105
106ompi-cuda:
107  extends: .stage-1
108  tags:
109  - stage1, name:p1
110  variables:
111    PYTHON: python3
112    CONFIG_OPTS: --with-mpi-dir=/home/petsc/soft/openmpi-4.0.2-cuda --with-cuda=1 --with-fc=0
113    TEST_SEARCH: snes_tutorials-ex19_cuda%
114    MAKE_CXXFLAGS: -Werror
115
116mpich-cxx-py3:
117  extends: .stage-1
118  variables:
119    PYTHON: python3
120    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11
121    TEST_SEARCH: snes_tutorials-ex48%
122
123uni-complex-float-int64:
124  extends: .stage-1
125  variables:
126    PYTHON: python3
127    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
128    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
129
130c99-mlib-static-py2:
131  extends: .stage-1
132  variables:
133    PYTHON: python2
134    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 CFLAGS=-std=c99
135    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t%
136    MAKE_TEST_FFLAGS: -Werror -std=f2008
137
138petsc4py-install:
139  extends: .stage-2
140  tags:
141    - gce-stage2
142  variables:
143    PYTHON: python3
144    T_PREFIX: petsc-install
145    T_DESTDIR: petsc-destdir
146    T_PETSC4PY: src/binding/petsc4py
147    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
148  script:
149    - printf "PATH:$PATH\n"
150    - mkdir hide
151    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
152    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
153    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
154    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
155    - make install DESTDIR="${PWD}/${T_DESTDIR}"
156    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
157    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
158    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
159    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
160    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
161    - printf "====== Test B. Install directly into prefix directory =====\n"
162    - make install
163    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
164    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
165    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
166    - printf "====== Test C. Install manually with setuptools =====\n"
167    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
168    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
169    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
170    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
171    - printf "====== Test D. Install manually with setuptools with staging =====\n"
172    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --root="${P}/${T_DESTDIR}" --install-lib="${P}/${T_PREFIX}/lib")
173    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
174    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
175
176checksource:
177  extends: .test-basic
178  stage: .pre
179  tags:
180    - gce-stage1
181  script:
182    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
183    - vermin --version
184    - make vermin
185    - make checkbadSource SHELL=bash
186    - make -f gmakefile check_output SHELL=bash
187    - make check_petsc4py_rst
188
189pause-for-approval:
190  extends: .test
191  stage: .pre
192  tags:
193    - gce-stage1
194  only:
195    refs:
196      - merge_requests
197    variables:
198      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
199      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
200  script:
201    - echo "pause-for-approval has no script to run"
202  variables:
203    GIT_STRATEGY: none
204  when: manual
205  allow_failure: false
206
207#
208# This provides the basic order of operations and options template for stage-2,3 tests.
209# Not all stage-2,3 need to follow this template, but most will.
210#
211.stage-23:
212  extends: .test
213  script:
214    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
215    - printf "PATH:$PATH\n"
216    - printf "PYTHONPATH:$PYTHONPATH\n"
217    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
218    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
219    - printf "./config/examples/${TEST_ARCH}.py\n"
220    - cat ./config/examples/${TEST_ARCH}.py
221    - ./config/examples/${TEST_ARCH}.py
222    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
223    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check
224    - make updatedatafiles
225    - if [ -z ${DISABLE_PETSC4PY_TESTS+x} ]; then if [ -z ${ENABLE_PETSC4PY_LDPRELOAD+x} ]; then echo "NOT using LD_PRELOAD"; make petsc4pytest; else echo "using LD_PRELOAD"; LD_PRELOAD=${PWD}/${TEST_ARCH}/lib/libpetsc.so make petsc4pytest; fi; fi
226    - if [ -z ${DISABLE_TESTS+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" cleantest allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS}; fi
227    - if [ ! -z ${RUN_GCOV+x} ]; then make gcov; fi
228  artifacts:
229    reports:
230      junit: ${TEST_ARCH}/tests/testresults.xml
231    name: "$CI_JOB_NAME"
232    when: always
233    paths:
234    - ${TEST_ARCH}/lib/petsc/conf/*.log
235    - ${TEST_ARCH}/lib/pkgconfig/petsc.pc
236    - ${TEST_ARCH}/tests/testresults.xml
237    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
238    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
239    - ${TEST_ARCH}/gcov.tar.gz
240    expire_in: 4 days
241  variables:
242    OPENBLAS_NUM_THREADS: 1
243
244.stage-2:
245  extends: .stage-23
246  stage: stage-2
247
248.stage-3:
249  extends: .stage-23
250  stage: stage-3
251
252#
253# The following provide templates for various OSes for pre/post info
254#
255
256.linux_test_noflags:
257  before_script:
258    - date
259    - hostname
260    - grep PRETTY_NAME /etc/os-release
261    - nproc
262    - lscpu
263    - ccache --zero-stats
264    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
265    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
266  after_script:
267    - date
268    - ccache --show-stats
269
270.linux_test_nofflags:
271  extends: .linux_test_noflags
272  variables:
273    MAKE_CFLAGS: -Werror
274    MAKE_CXXFLAGS: -Werror
275
276.linux_test:
277  extends: .linux_test_noflags
278  variables:
279    MAKE_CFLAGS: -Werror
280    MAKE_CXXFLAGS: -Werror
281    MAKE_FFLAGS: -Werror
282
283.freebsd_test:
284  variables:
285    MAKE_CFLAGS: -Werror
286    MAKE_CXXFLAGS: -Werror
287    MAKE_FFLAGS: -Werror
288  before_script:
289    - date
290    - hostname
291    - freebsd-version
292    - echo $(sysctl -n hw.ncpu)
293    - ccache --zero-stats
294  after_script:
295    - date
296    - ccache --show-stats
297
298.osx_test:
299  variables:
300    MAKE_CFLAGS: -Werror
301    MAKE_CXXFLAGS: -Werror
302    MAKE_FFLAGS: -Werror
303  before_script:
304    - date
305    - hostname
306    - sw_vers -productVersion
307    - echo $(sysctl -n hw.ncpu)
308    - ccache --zero-stats
309    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
310  after_script:
311    - date
312    - ccache --show-stats
313
314.opensolaris_test:
315  before_script:
316    - date
317    - hostname
318    - uname -a
319    - nproc
320    - isainfo -x
321  after_script:
322    - date
323
324.mswin_test:
325  before_script:
326    - date
327    - hostname
328    - uname -a
329    - nproc
330  after_script:
331    - date
332
333#
334# The following tests run as part of stage-2.
335#
336# The tags variable used in the tests below connects the particular test with the runners
337# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
338# For example the test linux-sycl-double any runner that has the tags 'gce-nfs, linux-fast'
339# (in a blue box beneath it)
340#
341
342osx-m1:
343  extends:
344    - .stage-3
345    - .osx_test
346  tags:
347    - os:macos-m1
348  variables:
349    TEST_ARCH: arch-ci-osx-m1
350    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
351    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
352
353freebsd-cxx-cmplx-64idx-dbg:
354  extends:
355    - .stage-2
356    - .freebsd_test
357  tags:
358    - os:fbsd
359  variables:
360    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
361
362freebsd-c-single-opt:
363  extends:
364    - .stage-2
365    - .freebsd_test
366  tags:
367    - os:fbsd
368  variables:
369    TEST_ARCH: arch-ci-freebsd-c-single-opt
370
371linux-cuda-double:
372  extends:
373    - .stage-3
374    - .linux_test
375  tags:
376    - gpu:nvidia, os:linux, name:p1
377  variables:
378    TEST_ARCH: arch-ci-linux-cuda-double
379
380linux-gcc-quad-64idx-dbg:
381  extends:
382    - .stage-2
383    - .linux_test
384  tags:
385    - gce-stage2
386  variables:
387    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
388
389linux-gcc-pkgs-opt:
390  extends:
391    - .stage-2
392    - .linux_test
393  tags:
394    - gce-stage2
395  variables:
396    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
397
398linux-gcc-complex-opt-32bit:
399  extends:
400    - .stage-2
401    - .linux_test
402  tags:
403    - gce-stage2
404  variables:
405    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
406
407#do not run checkstack on MSWIN-UNI
408mswin-uni:
409  extends:
410    - .stage-3
411    - .mswin_test
412  tags:
413    - win-stage2
414  variables:
415    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
416    TEST_ARCH: arch-ci-mswin-uni
417
418mswin-gnu:
419  extends:
420    - .stage-3
421    - .mswin_test
422  tags:
423    - win-stage2
424  variables:
425    TEST_ARCH: arch-ci-mswin-gnu
426    MAKE_CFLAGS: -Werror
427    MAKE_CXXFLAGS: -Werror
428    MAKE_FFLAGS: -Werror
429    DISABLE_TESTS: 1
430  artifacts:
431    reports:
432    paths:
433    - arch-*/lib/petsc/conf/*.log
434    expire_in: 4 days
435
436#
437# The following tests run as part of stage-3.
438#
439
440freebsd-cxx-cmplx-pkgs-dbg:
441  extends:
442    - .stage-3
443    - .freebsd_test
444  tags:
445    - os:fbsd
446  variables:
447    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
448
449freebsd-cxx-pkgs-opt:
450  extends:
451    - .stage-3
452    - .freebsd_test
453  tags:
454    - os:fbsd
455  variables:
456    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
457    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
458
459freebsd-pkgs-opt:
460  extends:
461    - .stage-3
462    - .freebsd_test
463  tags:
464    - os:fbsd
465  variables:
466    TEST_ARCH: arch-ci-freebsd-pkgs-opt
467
468linux-hip-double:
469  extends:
470    - .stage-3
471    - .linux_test_noflags
472  tags:
473    - gpu:amd, os:linux
474  variables:
475    TEST_ARCH: arch-ci-linux-hip-double
476
477linux-sycl-double:
478  extends:
479    - .stage-3
480    - .linux_test_noflags
481  tags:
482    - gce-nfs, linux-fast
483  variables:
484    TEST_ARCH: arch-ci-linux-sycl-double
485    LOAD_MODULES: compiler/latest mpi/latest cmake/3.20.5-yjp2hz6
486    TEST_OPTS: query=requires queryval=kokkos_kernels
487
488linux-c-exodus-dbg:
489  extends:
490    - .stage-3
491    - .linux_test
492  tags:
493    - gpu:nvidia, os:linux, name:frog
494  variables:
495    TEST_ARCH: arch-ci-linux-c-exodus-dbg
496    RUN_GCOV: 1
497    TEST_OPTS: -j1 query=requires queryval=cuda
498
499linux-cuda11-double:
500  extends:
501    - .stage-3
502    - .linux_test
503  tags:
504    - gpu:nvidia, os:linux, name:frog
505  variables:
506    TEST_ARCH: arch-ci-linux-cuda11-double
507    TEST_OPTS: -j1 query=requires queryval=cuda
508
509linux-cuda11-complex:
510  extends:
511    - .stage-3
512    - .linux_test
513  tags:
514    - gpu:nvidia, os:linux, name:frog
515  variables:
516    TEST_ARCH: arch-ci-linux-cuda11-complex
517    TEST_OPTS: -j1 query=requires queryval=cuda
518
519linux-cuda-double-64idx:
520  extends:
521    - .stage-3
522    - .linux_test
523  tags:
524    - gpu:nvidia, os:linux, name:p1
525  variables:
526    TEST_ARCH: arch-ci-linux-cuda-double-64idx
527    TEST_OPTS: -j1 query=requires queryval=cuda
528
529linux-cuda-single-cxx:
530  extends:
531    - .stage-3
532    - .linux_test
533  tags:
534    - gpu:nvidia, os:linux
535  variables:
536    TEST_ARCH: arch-ci-linux-cuda-single-cxx
537    TEST_OPTS: -j1 query=requires queryval=cuda
538
539linux-cuda-uni-pkgs:
540  extends:
541    - .stage-3
542    - .linux_test
543  tags:
544    - gpu:nvidia, os:linux
545  variables:
546    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
547    TEST_OPTS: -j4 query=requires queryval=cuda
548
549linux-viennacl:
550  extends:
551    - .stage-3
552    - .linux_test
553  tags:
554    - gpu:nvidia, os:linux
555  variables:
556    TEST_ARCH: arch-ci-linux-viennacl
557    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
558    TEST_OPTS: -j1 query=requires queryval=viennacl
559
560linux-without-fc:
561  extends:
562    - .stage-3
563    - .linux_test
564  tags:
565    - gce-nfs
566  variables:
567    TEST_ARCH: arch-ci-linux-without-fc
568
569linux-cmplx-single:
570  extends:
571    - .stage-3
572    - .linux_test
573  tags:
574    - name:si
575  variables:
576    FLEXIBLAS: netlib
577    TEST_ARCH: arch-ci-linux-cmplx-single
578
579linux-gcc-cxx-avx2:
580  extends:
581    - .stage-3
582    - .linux_test
583  tags:
584    - name:isdp001
585  variables:
586    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
587
588linux-clang-avx:
589  extends:
590    - .stage-3
591    - .linux_test
592  tags:
593    - name:isdp001
594  variables:
595    TEST_ARCH: arch-ci-linux-clang-avx
596
597linux-knl:
598  extends:
599    - .stage-3
600    - .linux_test
601  tags:
602    - name:isdp001
603  variables:
604    TEST_ARCH: arch-ci-linux-knl
605
606linux-intel-mkl-single:
607  extends:
608    - .stage-3
609    - .linux_test_nofflags
610  tags:
611    - name:isdp001
612  variables:
613    TEST_ARCH: arch-ci-linux-intel-mkl-single
614
615linux-cxx-cmplx-pkgs-64idx:
616  extends:
617    - .stage-3
618    - .linux_test
619  tags:
620    - gce-nfs
621  variables:
622    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
623    LOAD_MODULES: llvm/9.0.0-7fyffox gcc/8.3.0-fjpc5ys cmake/3.14.2-rl3q676
624
625# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
626linux-pkgs-dbg-ftn-interfaces:
627  extends:
628    - .stage-3
629    - .linux_test
630  tags:
631    - gce-nfs
632  variables:
633    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
634    LOAD_MODULES: cmake/3.20.5-yjp2hz6
635    OMP_PROC_BIND: "false"
636    OMP_NUM_THREADS: 4
637
638linux-pkgs-cxx-mlib:
639  extends:
640    - .stage-3
641    - .linux_test
642  tags:
643    - gce-nfs
644  variables:
645    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
646    LOAD_MODULES: gcc/11.1.0-5ikoznk cmake/3.20.5-yjp2hz6
647
648linux-pkgs-valgrind:
649  extends:
650    - .stage-3
651    - .linux_test
652  tags:
653    - gce-nfs, linux-fast
654  variables:
655    TEST_ARCH: arch-ci-linux-pkgs-valgrind
656    TIMEOUT: 7200
657    LOAD_MODULES: valgrind/3.17.0
658
659linux-pkgs-opt:
660  extends:
661    - .stage-3
662    - .linux_test
663  tags:
664    - gce-nfs, linux-fast
665  variables:
666    TEST_ARCH: arch-ci-linux-pkgs-opt
667    LOAD_MODULES: gcc/10.1.0-5hiqhdh
668
669linux-pkgs-gcov:
670  extends:
671    - .stage-3
672    - .linux_test
673  tags:
674    - gce-nfs, linux-gcov
675  variables:
676    TEST_ARCH: arch-ci-linux-pkgs-gcov
677    RUN_GCOV: 1
678
679linux-cmplx-gcov:
680  extends:
681    - .stage-3
682    - .linux_test
683  tags:
684    - gce-nfs, linux-gcov
685  variables:
686    PETSC_OPTIONS:  -vecscatter_mpi1 false -options_left false -checkstack
687    TEST_ARCH: arch-ci-linux-cmplx-gcov
688    LOAD_MODULES: gcc/8.3.0-fjpc5ys
689    RUN_GCOV: 1
690
691linux-matlab-ilp64-gcov:
692  extends:
693    - .stage-3
694    - .linux_test
695  tags:
696    - gce-nfs, linux-gcov
697  variables:
698    TEST_ARCH: arch-ci-linux-matlab-ilp64-gcov
699    LOAD_MODULES: matlab/R2018a
700    RUN_GCOV: 1
701  allow_failure: true
702
703linux-gcov:
704  extends:
705    - .stage-3
706    - .linux_test
707  tags:
708    - gce-nfs, linux-gcov
709  variables:
710    TEST_ARCH: arch-ci-linux-gcov
711    RUN_GCOV: 1
712
713linux-pgi:
714  extends:
715    - .stage-3
716    - .linux_test_noflags
717  tags:
718    - gce-nfs, linux-mcpu
719  variables:
720    TEST_ARCH: arch-ci-linux-pgi
721    LOAD_MODULES: hpc_sdk/20.9
722
723# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
724linux-nagfor:
725  extends:
726    - .stage-3
727    - .linux_test_nofflags
728  tags:
729    - gce-nfs, linux-mcpu
730  script:
731    - rm -f naglicenseproblem
732    - printf "PATH:$PATH\n"
733    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
734    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
735    - printf "./config/examples/${TEST_ARCH}.py\n"
736    - cat ./config/examples/${TEST_ARCH}.py
737    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
738    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
739    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
740    - make updatedatafiles
741    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" cleantest allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS} || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
742  variables:
743    LOAD_MODULES: nag/6.1
744    TEST_ARCH: arch-ci-linux-nagfor
745  allow_failure:
746    exit_codes: 126
747
748linux-intel-cmplx:
749  extends:
750    - .stage-3
751    - .linux_test_nofflags
752  tags:
753    - gce-nfs
754  variables:
755    TEST_ARCH: arch-ci-linux-intel-cmplx
756    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib cmake/3.20.5-yjp2hz6
757    ENABLE_PETSC4PY_LDPRELOAD: 1
758
759linux-xsdk-dbg:
760  extends:
761    - .stage-3
762    - .linux_test
763  tags:
764    - gce-nfs
765  variables:
766    TEST_ARCH: arch-ci-linux-xsdk-dbg
767    LOAD_MODULES: gcc/8.3.0-fjpc5ys
768
769linux-analyzer:
770  extends:
771    - .stage-2
772    - .linux_test
773  tags:
774    - gce-stage2
775  script:
776    - printf "PATH:$PATH\n"
777    - printf "PYTHONPATH:$PYTHONPATH\n"
778    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
779    - if [ ! -z ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME+x} ]; then printf "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\n" ;fi
780    - printf "./config/examples/${TEST_ARCH}.py\n"
781    - cat ./config/examples/${TEST_ARCH}.py
782    - ./config/examples/${TEST_ARCH}.py
783    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
784    - make LINTER_OPTIONS="${LINTER_OPTIONS}" lint
785  variables:
786    TEST_ARCH: arch-ci-linux-analyzer
787    LOAD_MODULES: llvm/12.0.0-hgg7qmu cmake/3.20.5-zyz2eld
788    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config --libdir`/libclang.so.12 --verbose --werror"
789  artifacts:
790    paths:
791    - ${TEST_ARCH}/lib/petsc/conf/*.log
792    - ./petscLintPatches/*.patch
793
794linux-intel:
795  extends:
796    - .stage-3
797    - .linux_test_nofflags
798  tags:
799    - gce-nfs
800  variables:
801    TEST_ARCH: arch-ci-linux-intel
802    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib
803
804linux-opt-misc:
805  extends:
806    - .stage-3
807    - .linux_test
808  tags:
809    - gce-nfs, linux-fast
810  variables:
811    TEST_ARCH: arch-ci-linux-opt-misc
812    LOAD_MODULES: gcc/6.5.0-57usejd
813
814linux-pkgs-64idx:
815  extends:
816    - .stage-3
817    - .linux_test
818  tags:
819    - gce-nfs, linux-mcpu
820  variables:
821    TEST_ARCH: arch-ci-linux-pkgs-64idx
822    LOAD_MODULES: cmake/3.20.5-yjp2hz6 intel-mkl/19.5
823
824linux-64idx-i8:
825  extends:
826    - .stage-3
827    - .linux_test
828  tags:
829    - gce-nfs
830  variables:
831    TEST_ARCH: arch-ci-linux-64idx-i8
832
833linux-gcc-ifc-cmplx:
834  extends:
835    - .stage-3
836    - .linux_test_nofflags
837  tags:
838    - gce-nfs
839  variables:
840    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
841    LOAD_MODULES: intel/19.0-nompilib cmake/3.20.0-vov726r
842
843linux-opt-cxx-quad:
844  extends:
845    - .stage-3
846    - .linux_test
847  tags:
848    - gce-nfs
849  variables:
850    TEST_ARCH: arch-ci-linux-opt-cxx-quad
851
852linux-ILP64:
853  extends:
854    - .stage-3
855    - .linux_test
856  tags:
857    - gce-nfs
858  variables:
859    TEST_ARCH: arch-ci-linux-ILP64
860    LOAD_MODULES: mpich/2-1.5-gcc750
861
862linux-64idx-i8-uni:
863  extends:
864    - .stage-3
865    - .linux_test
866  tags:
867    - gce-nfs
868  variables:
869    TEST_ARCH: arch-ci-linux-64idx-i8-uni
870
871mswin-intel-cxx-cmplx:
872  extends:
873    - .stage-3
874    - .mswin_test
875  tags:
876    - os:win
877  variables:
878    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
879
880#mswin-intel:
881#  extends:
882#    - .stage-3
883#    - .mswin_test
884#  tags:
885#    - os:win
886#  variables:
887#    TEST_ARCH: arch-ci-mswin-intel
888
889#mswin-opt-impi:
890#  extends:
891#    - .stage-3
892#    - .mswin_test
893#  tags:
894#    - os:win
895#  variables:
896#    TEST_ARCH: arch-ci-mswin-opt-impi
897#    DISABLE_TESTS: 1
898
899opensolaris-pkgs-opt:
900  extends:
901    - .stage-3
902    - .opensolaris_test
903  tags:
904    - name:n-gage
905  variables:
906    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
907
908opensolaris-cmplx-pkgs-dbg:
909  extends:
910    - .stage-3
911    - .opensolaris_test
912  tags:
913    - name:n-gage
914  variables:
915    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
916
917opensolaris-misc:
918  extends:
919    - .stage-3
920    - .opensolaris_test
921  tags:
922    - name:n-gage
923  variables:
924    TEST_ARCH: arch-ci-opensolaris-misc
925
926osx-cxx-cmplx-pkgs-dbg:
927  extends:
928    - .stage-3
929    - .osx_test
930  tags:
931    - os:macos
932  variables:
933    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
934
935osx-cxx-pkgs-opt:
936  extends:
937    - .stage-3
938    - .osx_test
939  tags:
940    - os:macos, opt
941  variables:
942    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
943    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
944    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
945
946osx-dbg:
947  extends:
948    - .stage-3
949    - .osx_test
950  tags:
951    - os:macos
952  variables:
953    TEST_ARCH: arch-ci-osx-dbg
954
955osx-xsdk-opt:
956  extends:
957    - .stage-3
958    - .osx_test
959  tags:
960    - os:macos, opt
961  variables:
962    TEST_ARCH: arch-ci-osx-xsdk-opt
963
964# job for analyzing the final coverage results
965analyze-pipeline:
966  extends: .test
967  stage: .post
968  tags:
969    - gce-nfs-short
970  dependencies:
971    - linux-c-exodus-dbg
972    - linux-pkgs-gcov
973    - linux-cmplx-gcov
974    - linux-matlab-ilp64-gcov
975    - linux-gcov
976  variables:
977    PETSC_ARCH: arch-ci-analyze-pipeline
978  before_script:
979    - date
980    - hostname
981  script:
982  - ./configure --with-mpi=0 --with-cxx=0 --with-c2html
983  - make srchtml
984  - make mergegcov
985  artifacts:
986    name: "$CI_JOB_NAME"
987    when: always
988    paths:
989    - arch-ci-analyze-pipeline/*
990    expire_in: 4 days
991
992
993#
994# Base job for a documentation build
995#
996.docs:
997  stage: stage-2
998  tags:
999    - gce-stage2
1000  before_script:
1001    - VENV=venv-petsc-docs &&
1002      python3 -m venv $VENV &&
1003      . $VENV/bin/activate &&
1004      cd doc &&
1005      pip install -r requirements.txt
1006
1007#
1008# Build documentation and make available for review using GitLab pages
1009#
1010docs-review:
1011  extends:
1012    - .docs
1013    - .test-basic
1014  script:
1015    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1016    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1017    - cp _build/latex/manual.pdf ../public/html/docs/manual/
1018  environment:
1019    name: review/$CI_COMMIT_REF_NAME
1020    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1021  artifacts:
1022    paths:
1023      - public
1024  except:
1025    variables:
1026      - $PETSC_CI_SCHEDULED =~ /yes/
1027
1028#
1029# Deploy documentation using GitLab pages
1030#
1031pages:  # this job name has special meaning to GitLab
1032  extends: .docs
1033  interruptible: true
1034  script:
1035    - mkdir -p ../public/ && cp public/* ../public/
1036    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1037    - git checkout origin/main && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/main" && make latexpdf && mkdir -p ../public/main/docs/manual && cp _build/latex/manual.pdf ../public/main/docs/manual/
1038    - make clean BUILDDIR="../public/release"
1039    - git checkout origin/release && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/release" && make latexpdf && mkdir -p ../public/release/docs/manual && cp _build/latex/manual.pdf ../public/release/docs/manual/
1040  only:
1041    variables:
1042      - $PETSC_CI_SCHEDULED == "yes"
1043  artifacts:
1044    paths:
1045      - public
1046
1047#
1048#
1049# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1050# that fail produce a warning, but do not block execution of a pipeline.
1051#
1052
1053.test-experimental:
1054  extends: .test
1055  allow_failure: true
1056
1057