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