xref: /petsc/.gitlab-ci.yml (revision e14e8d212ccaab5086ee6fa5f29b1dcd907e13db)
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
16  - stage-4
17variables:
18  GIT_STRATEGY: fetch
19  GIT_CLEAN_FLAGS: -ffdxq
20  TIMEOUT: 450
21  BASE_EXTRA_OPTIONS: -nox -nox_warning -malloc_dump
22  UCX_LOG_LEVEL: error
23
24#
25# The most basic template that most tests will expand upon
26#
27
28.test-basic:
29  interruptible: true
30  only:
31    refs:
32      #     Set with CI/CD Shedules - New Schedule
33      - schedules
34      - api
35      #     Set with CI/CD Pipelines - Run Pipeline
36      - web
37      - merge_requests
38  dependencies: []
39
40.test:
41  extends: .test-basic
42  except:
43    variables:
44      # Skip if the docs-only label is attached to a merge request
45      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)docs-only($|,)/
46      - $PETSC_CI_SCHEDULED =~ /yes/
47
48check-ci-settings:
49  extends: .test-basic
50  stage: .pre
51  tags:
52    - gce-stage1
53  script:
54    - lib/petsc/bin/maint/check-ci-settings.sh
55
56#
57#  This provides the basic order of operations and options template for cloud based stage 1 tests.
58#  Not all test-short need to follow this template but most will.
59#
60
61.stage-1:
62  extends: .test
63  stage: stage-1
64  tags:
65    - gce-u22-stage1
66  before_script:
67    - date
68    - hostname
69    - grep PRETTY_NAME /etc/os-release
70    - nproc
71    - lscpu
72    - ccache --zero-stats
73  script:
74    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
75    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; if [ -f ${HOME}/${INIT_SCRIPT} ]; then source ${HOME}/${INIT_SCRIPT}; else source ${INIT_SCRIPT}; fi; fi
76    - printf "PATH:$PATH\n"
77    - printf "PYTHONPATH:$PYTHONPATH\n"
78    - printf "python:${PYTHON}\n"
79    - ${PYTHON} -m pip list --user
80    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
81    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
82    - printf "MODULEPATH:$MODULEPATH\n"
83    - 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
84    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
85    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}"
86    - if [ ! -z ${ENABLE_CHECK+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" check; fi
87    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
88    - if [ ! -z ${ENABLE_COMPILETESTS+x} ]; then make -j 16 CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" test PRINTONLY=1; fi
89  variables:
90    PYTHON: python3
91    MAKE_CFLAGS: -Werror -Wmissing-field-initializers
92    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
93    MAKE_FFLAGS: -Werror -fimplicit-none
94    MAKE_TEST_CFLAGS: -Werror
95    MAKE_TEST_CXXFLAGS: -Werror
96    MAKE_TEST_FFLAGS: -Werror
97  after_script:
98    - date
99    - ccache --show-stats
100  artifacts:
101    reports:
102      junit: arch-*/tests/testresults.xml
103    name: "$CI_JOB_NAME"
104    when: always
105    paths:
106      - arch-*/lib/petsc/conf/*.log
107      - arch-*/lib/pkgconfig/petsc.pc
108      - arch-*/tests/testresults.xml
109      - arch-*/tests/test_*_tap.log
110      - arch-*/tests/test_*_err.log
111    expire_in: 4 days
112
113#
114# The following tests run on the cloud as part of stage-1.
115#
116
117fp16-arm:
118  extends: .stage-1
119  tags:
120    - linux-arm-stage1
121  variables:
122    CONFIG_OPTS: --with-precision=__fp16 --with-fc=0 --with-mpi-dir=/software/mpich-4.2.3 --with-blaslapack-dir=/software/f2cblaslapack
123    TEST_SEARCH: vec_vec_tests-ex6%
124    MAKE_CXXFLAGS: -O1 -Werror
125
126ompi-cuda:
127  extends: .stage-1
128  tags:
129    - cuda-stage1
130  variables:
131    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-cuda-arch=all-major --CUDAPPFLAGS=-Wno-deprecated-gpu-targets --with-fc=0
132    TEST_SEARCH: snes_tutorials-ex19_cuda%
133    ENABLE_CHECK: 1
134    MAKE_CXXFLAGS: -Werror
135    MAKE_CUDAFLAGS: -Xcompiler -Wall -Xcompiler -Werror
136
137mpich-cxx-py3:
138  extends: .stage-1
139  variables:
140    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11 --with-strict-petscerrorcode
141    TEST_SEARCH: snes_tutorials-ex48%
142    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
143
144mpich-cxx-mlib:
145  extends: .stage-1
146  variables:
147    CONFIG_OPTS: --with-clanguage=cxx --with-single-library=0 --with-log=0 --with-info=0 --with-ctable=0 --with-is-color-value-type=short CXXFLAGS=-std=c++14
148    TEST_SEARCH: snes_tutorials-ex48%
149    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
150
151uni-complex-float-int64:
152  extends: .stage-1
153  variables:
154    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
155    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
156    LOAD_MODULES: gcc/12.1.0
157
158c99-mlib-static-py:
159  extends: .stage-1
160  variables:
161    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 --with-strict-petscerrorcode CFLAGS=-std=c99 FFLAGS=="-ffree-line-length-none -ffree-line-length-0" CXXFLAGS=
162    ENABLE_CHECK: 1
163    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t% tao_unconstrained_tutorials-rosenbrock1% ml_regressor_tests-ex3_ols%
164    MAKE_TEST_CFLAGS: -Werror -std=c99 -Wdeclaration-after-statement
165    MAKE_TEST_FFLAGS: -Werror -std=f2008
166    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
167
168clang-uni:
169  extends: .stage-1
170  variables:
171    CONFIG_OPTS: --with-cc=clang --with-cxx=clang++ --with-mpi=0 --with-strict-petscerrorcode FPPFLAGS=-fsecond-underscore
172    MAKE_CFLAGS: -Werror -Wmissing-field-initializers -Wundef -Wextra-semi-stmt
173    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant -Wundef -Wextra-semi-stmt -Wextra-semi
174    MAKE_TEST_CFLAGS: -Werror -Wmissing-field-initializers -Wundef -Wextra-semi-stmt
175    MAKE_TEST_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant -Wundef -Wextra-semi-stmt -Wextra-semi
176    TEST_SEARCH: snes_tutorials-ex48% snes_tutorials-ex5f%
177    ENABLE_COMPILETESTS: 1
178
179gcc-lto:
180  extends: .stage-1
181  variables:
182    CONFIG_OPTS: CFLAGS= CXXFLAGS= FFLAGS="-ffree-line-length-none -ffree-line-length-0"
183    MAKE_CFLAGS: -Werror -flto=4 -Werror=odr -Werror=lto-type-mismatch
184    MAKE_CXXFLAGS: -Werror -Wextra-semi -flto=4 -Werror=odr -Werror=lto-type-mismatch
185    MAKE_FFLAGS: -Werror -flto=4 -Werror=odr -Werror=lto-type-mismatch
186    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f%
187    LOAD_MODULES: gcc/12.1.0 mpich/4.1-gcc-12.1.0
188
189petsc4py-install:
190  extends: .stage-2
191  tags:
192    - gce-u22-stage1
193  variables:
194    PYTHON: python3
195    T_PREFIX: petsc-install
196    T_DESTDIR: petsc-destdir
197    T_PETSC4PY: src/binding/petsc4py
198    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
199  script:
200    - printf "PATH:$PATH\n"
201    - mkdir hide
202    - 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
203    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
204    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
205    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
206    - make install DESTDIR="${PWD}/${T_DESTDIR}"
207    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
208    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
209    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
210    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
211    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
212    - printf "====== Test B. Install directly into prefix directory =====\n"
213    - make install
214    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
215    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
216    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
217    - printf "====== Test C. Install manually with setuptools =====\n"
218    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
219    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
220    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
221    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
222    - printf "====== Test D. Install manually with setuptools with staging =====\n"
223    - 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")
224    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
225    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
226
227petsc4py-pip:
228  extends: .stage-2
229  tags:
230    - gce-u22-stage1
231  variables:
232    PETSC_CONFIGURE_OPTIONS: --with-mpi=0 --with-fc=0
233    CFLAGS: -O0
234  script:
235    - python3 -m venv pip-builds
236    - source pip-builds/bin/activate
237    - python -m pip install --upgrade pip
238    - unset PETSC_DIR PETSC_ARCH
239    - export PIP_WHEEL_DIR="${PWD}/wheelhouse"
240    - export PIP_FIND_LINKS="${PIP_WHEEL_DIR}"
241    - mkdir -p "${PIP_WHEEL_DIR}"
242    - python -m pip wheel .
243    - python -m pip wheel src/binding/petsc4py
244    - python -m pip install --pre --no-index --no-cache-dir petsc4py
245    - python -m pip list
246    - python -m petsc --prefix
247    - python -m petsc4py
248
249checksource:
250  extends: .test-basic
251  stage: .pre
252  tags:
253    - gce-u22-stage1
254  script:
255    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0 --with-coverage-exec=0 --with-syclc=0 --with-hipc=0 --with-cudac=0 --with-x=0 --with-bison=0 --with-cmake=0 --with-pthread=0 --with-mkl_sparse_optimize=0 --with-mkl_sparse=0 --with-debugging=0
256    - vermin --version
257    - make vermin
258    - PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2025-08-26-llvm/opt/spack/linux-x86_64/llvm-21.1.0-yu5atp22wbrkzn6ia3vqu5lsaw57ejnn/bin:$PATH make checkclangformat checkfprettifyformat SHELL=bash
259    - make checkbadSource SHELL=bash
260    - make checkbadFileChange SHELL=bash
261    - make -f gmakefile check_output SHELL=bash
262    - make check_petsc4py_rst
263    - make -C src/binding/petsc4py lint
264  artifacts:
265    name: "$CI_JOB_NAME"
266    when: always
267    paths:
268      - arch-*/lib/petsc/conf/*.patch
269      - arch-*/lib/petsc/conf/*.log
270    expire_in: 4 days
271
272pause-for-approval:
273  extends: .test
274  stage: .pre
275  tags:
276    - gce-stage1
277  only:
278    refs:
279      - merge_requests
280    variables:
281      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
282      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
283  script:
284    - echo "pause-for-approval has no script to run"
285  variables:
286    GIT_STRATEGY: none
287  when: manual
288  allow_failure: false
289
290#
291# Basic template for code coverage generation. Tests should additionally inherit from the more
292# specialized OS-specific versions instead of this one.
293#
294
295.coverage-generate:
296  variables:
297    RUN_GCOV: 1
298    RUN_GCOV_OPTIONS: --decisions
299
300.coverage-disable:
301  variables:
302    RUN_GCOV: 0
303
304#
305# This provides the basic order of operations and options template for stage-2,3 tests.
306# Not all stage-2,3 need to follow this template, but most will.
307#
308.stage-23:
309  extends:
310    - .test
311    - .coverage-generate
312  script:
313    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
314    - if [ ! -z ${GCOV_MODULES+x} ]; then module --trace load ${GCOV_MODULES}; module list; fi
315    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; if [ -f ${HOME}/${INIT_SCRIPT} ]; then source ${HOME}/${INIT_SCRIPT}; else source ${INIT_SCRIPT}; fi; fi
316    - if [ "${RUN_GCOV}" == 1 ]; then
317      printf "RUN_GCOV_OPTIONS:$RUN_GCOV_OPTIONS\n";
318      gcovr --version;
319      fi
320    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec touch {} \; -exec rm -rf {} \; ; fi
321    - printf "PATH:$PATH\n"
322    - printf "PYTHONPATH:$PYTHONPATH\n"
323    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
324    - 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
325    - printf "./config/examples/${TEST_ARCH}.py\n"
326    - cat ./config/examples/${TEST_ARCH}.py
327    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
328    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
329    - export ASAN_OPTIONS="log_path=stdout:detect_leaks=false" UBSAN_OPTIONS="suppressions=${PWD}/share/petsc/suppressions/ubsan" # only needed for -fsanitize=undefined (but harmless otherwise)
330    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}" EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
331    - make updatedatafiles
332    - if [ -z ${DISABLE_PETSC4PY_TESTS+x} ]; then if [ -z ${ENABLE_PETSC4PY_LDPRELOAD+x} ]; then echo "NOT using LD_PRELOAD"; make EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" petsc4pytest; else echo "using LD_PRELOAD"; LD_PRELOAD=${PWD}/${TEST_ARCH}/lib/libpetsc.so make EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" petsc4pytest; fi; fi
333    - if [ -z ${DISABLE_TESTS+x} ]; then make cleantest && make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" CUDAFLAGS="${MAKE_CUDAFLAGS}"  EXTRA_OPTIONS_INITIAL="${EXTRA_OPTIONS_INITIAL} ${BASE_EXTRA_OPTIONS}" allgtests-tap TIMEOUT=${TIMEOUT} ${TEST_OPTS} || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi; fi
334    - if [ "${RUN_GCOV}" == 1 ]; then make gcov PETSC_GCOV_OPTIONS="${RUN_GCOV_OPTIONS}"; fi
335  artifacts:
336    reports:
337      junit: arch-*/tests/testresults.xml
338    name: "$CI_JOB_NAME"
339    when: always
340    paths:
341      - arch-*/lib/petsc/conf/*.log
342      - arch-*/lib/pkgconfig/petsc.pc
343      - arch-*/tests/testresults.xml
344      - arch-*/tests/test_arch-*_tap.log
345      - arch-*/tests/test_arch-*_err.log
346      - arch-*/arch-*-gcovr-report.json.tar.bz2
347    expire_in: 4 days
348  variables:
349    OPENBLAS_NUM_THREADS: 1
350
351.stage-2:
352  extends: .stage-23
353  stage: stage-2
354
355.stage-3:
356  extends: .stage-23
357  stage: stage-3
358
359#
360# The following provide templates for various OSes for pre/post info
361#
362
363.linux_test_noflags:
364  before_script:
365    - date
366    - hostname
367    - grep PRETTY_NAME /etc/os-release
368    - nproc
369    - lscpu
370    - ccache --zero-stats
371  after_script:
372    - date
373    - ccache --show-stats
374
375.linux_test_nofflags:
376  extends: .linux_test_noflags
377  variables:
378    MAKE_CFLAGS: -Werror
379    MAKE_CXXFLAGS: -Werror
380
381.linux_test:
382  extends: .linux_test_noflags
383  variables:
384    MAKE_CFLAGS: -Werror
385    MAKE_CXXFLAGS: -Werror
386    MAKE_FFLAGS: -Werror
387
388.freebsd_test:
389  extends:
390    - .coverage-disable
391  variables:
392    MAKE_CFLAGS: -Werror
393    MAKE_CXXFLAGS: -Werror
394    MAKE_FFLAGS: -Werror
395  before_script:
396    - date
397    - hostname
398    - freebsd-version
399    - echo $(sysctl -n hw.ncpu)
400    - ccache --zero-stats
401  after_script:
402    - date
403    - ccache --show-stats
404
405.macos_test:
406  variables:
407    MAKE_CFLAGS: -Werror
408    MAKE_CXXFLAGS: -Werror
409    MAKE_FFLAGS: -Werror
410  before_script:
411    - date
412    - hostname
413    - sw_vers -productVersion
414    - echo $(sysctl -n hw.ncpu)
415    - ccache --zero-stats
416  after_script:
417    - date
418    - ccache --show-stats
419
420.mswin_test:
421  extends:
422    - .coverage-disable
423  before_script:
424    - date
425    - hostname
426    - uname -a
427    - nproc
428  after_script:
429    - date
430
431#
432# The following tests run as part of stage-2.
433#
434# The tags variable used in the tests below connects the particular test with the runners
435# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
436# For example the test 'linux-sycl-double' any runner that has the tags 'gce-u22-stage3, linux-fast'
437# (in a blue box beneath it)
438#
439
440macos-arm:
441  extends:
442    - .stage-3
443    - .macos_test
444    - .coverage-disable
445  tags:
446    - os:macos-arm
447  variables:
448    TEST_ARCH: arch-ci-macos-arm
449    EXTRA_OPTIONS_INITIAL: -check_pointer_intensity 0 -error_output_stdout
450    INIT_SCRIPT: .zprofile
451
452freebsd-cxx-cmplx-64idx-dbg:
453  extends:
454    - .stage-2
455    - .freebsd_test
456  tags:
457    - os:fbsd
458  variables:
459    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
460
461freebsd-c-single-opt:
462  extends:
463    - .stage-2
464    - .freebsd_test
465  tags:
466    - os:fbsd
467  variables:
468    TEST_ARCH: arch-ci-freebsd-c-single-opt
469
470mswin-opt-impi:
471  extends:
472    - .stage-3
473    - .mswin_test
474  tags:
475    - mswin-stage3
476  variables:
477    TEST_ARCH: arch-ci-mswin-opt-impi
478    TEST_OPTS: search='ksp_ksp_tests*'
479
480linux-gcc-quad-64idx-dbg:
481  extends:
482    - .stage-2
483    - .linux_test
484  tags:
485    - gce-u24-stage2
486    - linux-gcov
487  variables:
488    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
489
490linux-gcc-pkgs-opt:
491  extends:
492    - .stage-2
493    - .linux_test
494  tags:
495    - gce-u24-stage2
496    - linux-gcov
497  variables:
498    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
499  except:
500    variables:
501      - $PETSC_CI_SCHEDULED =~ /yes/
502
503linux-gcc-complex-opt-32bit:
504  extends:
505    - .stage-2
506    - .linux_test
507  tags:
508    - gce-u24-stage2
509    - linux-gcov
510  variables:
511    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
512
513linux-emcc:
514  extends:
515    - .stage-2
516    - .linux_test
517    - .coverage-disable
518  tags:
519    - gce-u24-stage2
520  variables:
521    TEST_ARCH: arch-ci-linux-emcc
522    INIT_SCRIPT: /nfs/gce/projects/petsc/soft/u22.04/emsdk/emsdk_env.sh
523    DISABLE_TESTS: 1
524
525#
526# The following tests run as part of stage-3.
527#
528
529freebsd-cxx-cmplx-pkgs-dbg:
530  extends:
531    - .stage-3
532    - .freebsd_test
533  tags:
534    - os:fbsd
535  variables:
536    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
537
538freebsd-cxx-pkgs-opt:
539  extends:
540    - .stage-3
541    - .freebsd_test
542  tags:
543    - os:fbsd
544  variables:
545    EXTRA_OPTIONS_INITIAL: -vecscatter_mpi1 false -options_left false
546    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
547
548freebsd-pkgs-opt:
549  extends:
550    - .stage-3
551    - .freebsd_test
552  tags:
553    - os:fbsd
554  variables:
555    TEST_ARCH: arch-ci-freebsd-pkgs-opt
556    MAKE_CFLAGS: -DPETSC_SKIP_COMPLEX -Werror
557
558linux-hip-double:
559  extends:
560    - .stage-3
561    - .linux_test_noflags
562    - .coverage-disable
563  tags:
564    - gpu:amd
565    - os:linux
566  variables:
567    TEST_ARCH: arch-ci-linux-hip-double
568
569linux-hip-cmplx:
570  extends:
571    - .stage-3
572    - .linux_test_noflags
573    - .coverage-disable
574  tags:
575    - gpu:amd
576    - os:linux
577  variables:
578    TEST_ARCH: arch-ci-linux-hip-cmplx
579
580linux-sycl-double:
581  extends:
582    - .stage-3
583    - .linux_test_nofflags
584    - .coverage-disable
585  tags:
586    - gce-u22-stage3
587    - linux-fast
588  variables:
589    MODULEPATH: /nfs/gce/projects/petsc/soft/oneapi/2025.2.0/modulefiles
590    TEST_ARCH: arch-ci-linux-sycl-double
591    LOAD_MODULES: tbb/latest compiler-rt/latest umf/latest compiler/latest mpi/latest dpl/latest
592    TEST_OPTS: query=requires queryval=kokkos_kernels
593    MAKE_CFLAGS: -Wno-expected-file-type -Werror
594
595linux-cuda-pkgs:
596  extends:
597    - .stage-3
598    - .linux_test
599  tags:
600    - cuda-stage3
601  variables:
602    TEST_ARCH: arch-ci-linux-cuda-pkgs
603    # run all tests that:
604    # 1. require cuda, OR
605    # 2. require device, OR
606    # 3. require hypre, OR
607    # 4. require kokkos[_kernels], AND lives in the vec subdirectory
608    #
609    # need to use the alternate OR spelling since '|' is interpreted as a pipe by the
610    # shell, and I could not manage to escape it enough times...
611    TEST_OPTS: -j3 queryval='cuda,device,hypre,kokkos*,vec*' query='requires,requires,requires,requires%OR%name'
612    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
613    OMP_PROC_BIND: false
614
615linux-cuda112-omp:
616  extends:
617    - .stage-3
618    - .linux_test
619    - .coverage-disable
620  tags:
621    - cuda-stage3
622  variables:
623    TEST_ARCH: arch-ci-linux-cuda112-omp
624    TEST_OPTS: -j4 query=requires queryval=kokkos_kernels
625    LOAD_MODULES: cuda/11.2.2 u-gcc-9/9.4.0
626    OMP_PROC_BIND: "false"
627    OMP_NUM_THREADS: 1
628    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
629
630linux-cuda-cmplx:
631  extends:
632    - .stage-3
633    - .linux_test
634  tags:
635    - cuda-stage3
636  variables:
637    TEST_ARCH: arch-ci-linux-cuda-cmplx
638    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
639
640linux-cuda-double-64idx:
641  extends:
642    - .stage-3
643    - .linux_test
644  tags:
645    - cuda12
646  variables:
647    TEST_ARCH: arch-ci-linux-cuda-double-64idx
648    TEST_OPTS: -j3 query=requires queryval=cuda
649    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
650
651linux-cuda-latest:
652  extends:
653    - .stage-3
654    - .linux_test
655  tags:
656    - cuda13
657  variables:
658    TEST_ARCH: arch-ci-linux-cuda-latest
659    TEST_OPTS: -j3 query=requires queryval=cuda
660    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
661
662linux-cuda-single-cxx:
663  extends:
664    - .stage-3
665    - .linux_test_noflags
666    - .coverage-disable
667  tags:
668    - cuda-stage3
669  variables:
670    TEST_ARCH: arch-ci-linux-cuda-single-cxx
671    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
672    LOAD_MODULES: nvhpc-22.11-gcc-11.3.0-vmvmbrx
673    TEST_OPTS: -j15 query=requires queryval=cuda
674
675linux-cuda-uni-pkgs:
676  extends:
677    - .stage-3
678    - .linux_test
679  tags:
680    - cuda-stage3
681  variables:
682    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
683    TEST_OPTS: -j20 query=requires queryval=cuda
684    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
685
686linux-clang-cuda:
687  extends:
688    - .stage-3
689    - .linux_test
690    - .coverage-disable
691  tags:
692    - cuda-stage3
693  variables:
694    TEST_ARCH: arch-ci-linux-clang-cuda
695    TEST_OPTS: -j 1 queryval='cuda*,snes*' query='requires%OR%name'
696    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
697    LOAD_MODULES: llvm-15.0.7-gcc-11.3.0-pjldtxf cuda-11.5.2-gcc-11.3.0-jkoottx gcc-11.3.0-gcc-11.3.0-pgrvke5
698    MAKE_CUDAFLAGS: -Wno-pass-failed -Werror
699
700linux-viennacl:
701  extends:
702    - .stage-3
703    - .linux_test
704  tags:
705    - cuda-stage3
706  variables:
707    TEST_ARCH: arch-ci-linux-viennacl
708    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
709    TEST_OPTS: -j20 query=requires queryval=viennacl
710
711linux-without-fc:
712  extends:
713    - .stage-3
714    - .linux_test
715  tags:
716    - gce-u22-stage3
717  variables:
718    TEST_ARCH: arch-ci-linux-without-fc
719
720linux-flang-arm:
721  extends:
722    - .stage-3
723    - .linux_test_noflags
724    # gcovr does not work on arm/linux
725    - .coverage-disable
726  tags:
727    - arch:arm
728    - os:linux
729  variables:
730    TEST_ARCH: arch-ci-linux-flang-arm
731
732linux-cmplx-single-arm:
733  extends:
734    - .stage-3
735    - .linux_test
736    # gcovr does not work on arm/linux
737    - .coverage-disable
738  tags:
739    - arch:arm
740    - os:linux
741  variables:
742    FLEXIBLAS: netlib
743    TEST_ARCH: arch-ci-linux-cmplx-single-arm
744
745linux-gcc-cxx-avx2:
746  extends:
747    - .stage-3
748    - .linux_test
749  tags:
750    - name:petsc-knl-01
751  variables:
752    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
753
754linux-clang-avx:
755  extends:
756    - .stage-3
757    - .linux_test
758  tags:
759    - name:petsc-knl-01
760  variables:
761    TEST_ARCH: arch-ci-linux-clang-avx
762
763linux-knl:
764  extends:
765    - .stage-3
766    - .linux_test
767    - .coverage-disable
768  tags:
769    - name:petsc-knl-01
770  variables:
771    MAKE_FFLAGS: -warn errors
772    TEST_ARCH: arch-ci-linux-knl
773    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
774
775linux-intel-mkl-single:
776  extends:
777    - .stage-3
778    - .linux_test_nofflags
779    - .coverage-disable
780  tags:
781    - name:petsc-knl-01
782  variables:
783    TEST_ARCH: arch-ci-linux-intel-mkl-single
784    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
785
786linux-cxx-cmplx-pkgs-64idx:
787  extends:
788    - .stage-3
789    - .linux_test
790  tags:
791    - gce-u22-stage3
792  variables:
793    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
794    EXTRA_OPTIONS_INITIAL: -fp_trap
795    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
796    LOAD_MODULES: python/3.13.0rc1-rayc5m7 py-setuptools/69.2.0-6yku3zk python-venv/1.0-bnbfk2n py-pip/23.1.2-o7dlzno
797
798# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
799linux-pkgs-dbg-ftn-interfaces:
800  extends:
801    - .stage-3
802    - .linux_test
803    - .coverage-disable
804  tags:
805    - gce-u22-stage3
806  variables:
807    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
808    OMP_PROC_BIND: "false"
809    OMP_NUM_THREADS: 4
810    EXTRA_OPTIONS_INITIAL: -fp_trap
811
812linux-pkgs-cxx-mlib:
813  extends:
814    - .stage-3
815    - .linux_test
816  tags:
817    - gce-u22-stage3
818  variables:
819    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
820    EXTRA_OPTIONS_INITIAL: -fp_trap
821    LOAD_MODULES: python/3.8.13
822
823linux-pkgs-valgrind:
824  extends:
825    - .stage-3
826    - .linux_test
827  tags:
828    - gce-valgrind
829  variables:
830    TEST_ARCH: arch-ci-linux-pkgs-valgrind
831    TIMEOUT: 1200
832    UCX_SYSV_HUGETLB_MODE: n
833
834linux-pkgs-opt:
835  extends:
836    - .stage-3
837    - .linux_test
838  tags:
839    - gce-u22-stage3
840    - linux-fast
841  variables:
842    TEST_ARCH: arch-ci-linux-pkgs-opt
843    LOAD_MODULES: gcc/12.1.0
844    MAKE_CFLAGS: -Wno-unused-const-variable -Werror
845    MAKE_CXXFLAGS: -Wno-deprecated-declarations -Werror
846    MPI4PY_BUILD_PYSABI: 1
847    PETSC4PY_BUILD_PYSABI: 1
848    SLEPC4PY_BUILD_PYSABI: 1
849
850linux-pkgs-dbg:
851  extends:
852    - .stage-3
853    - .linux_test
854  tags:
855    - gce-u22-stage3
856    - linux-gcov
857  variables:
858    TEST_ARCH: arch-ci-linux-pkgs-dbg
859    EXTRA_OPTIONS_INITIAL: -fp_trap
860
861linux-matlab-ilp64:
862  extends:
863    - .stage-3
864    - .linux_test
865  tags:
866    - gce-u22-stage3
867    - linux-gcov
868  variables:
869    TEST_ARCH: arch-ci-linux-matlab-ilp64
870    LOAD_MODULES: gcc/9.4.0 matlab/R2022a
871  allow_failure: true
872
873linux-intel-cmplx:
874  extends:
875    - .stage-3
876    - .linux_test_nofflags
877    - .coverage-disable
878  tags:
879    - gce-u22-stage3
880  variables:
881    TEST_ARCH: arch-ci-linux-intel-cmplx
882    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
883
884linux-misc-dbg:
885  extends:
886    - .stage-3
887    - .linux_test
888  tags:
889    - gce-u22-stage3
890  variables:
891    TEST_ARCH: arch-ci-linux-misc-dbg
892    LOAD_MODULES: gcc/12.1.0
893
894check-each-commit:
895  extends:
896    - .stage-2
897    - .linux_test
898    - .coverage-disable
899  tags:
900    - gce-u22-stage2
901  script:
902    - export PATH=/nfs/gce/projects/petsc/soft/u22.04/spack-2025-08-26-llvm/opt/spack/linux-x86_64/llvm-21.1.0-yu5atp22wbrkzn6ia3vqu5lsaw57ejnn/bin:$PATH
903    - lib/petsc/bin/maint/check-each-commit.sh
904  except:
905    variables:
906      - $PETSC_CI_SCHEDULED =~ /yes/
907  allow_failure: true
908
909linux-analyzer:
910  extends:
911    - .stage-2
912    - .linux_test
913    - .coverage-disable
914  tags:
915    - gce-u22-stage2
916  script:
917    - printf "PATH:$PATH\n"
918    - printf "PYTHONPATH:$PYTHONPATH\n"
919    - python3 --version
920    - git --version
921    - mypy --version
922    - vermin --version
923    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
924    - 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
925    - printf "./config/examples/${TEST_ARCH}.py\n"
926    - cat ./config/examples/${TEST_ARCH}.py
927    - ./config/examples/${TEST_ARCH}.py
928    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
929    - make V=3 LINTER_OPTIONS="${LINTER_OPTIONS} -- ./src" lint
930  variables:
931    TEST_ARCH: arch-ci-linux-analyzer
932    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --werror 1"
933  artifacts:
934    paths:
935      - arch-*/lib/petsc/conf/*.log
936      - ./petscLintPatches/*.patch
937    expire_in: 4 days
938  except:
939    variables:
940      - $PETSC_CI_SCHEDULED =~ /yes/
941
942linux-intel:
943  extends:
944    - .stage-3
945    - .linux_test_nofflags
946    - .coverage-disable
947  tags:
948    - gce-u22-stage3
949  variables:
950    TEST_ARCH: arch-ci-linux-intel
951    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
952
953linux-clang-ubsan:
954  extends:
955    - .stage-2
956    - .linux_test
957    - .coverage-disable
958  tags:
959    - gce-u22-stage2
960  variables:
961    TEST_ARCH: arch-ci-linux-clang-ubsan
962    LOAD_MODULES: llvm/17.0.4
963
964linux-opt-arm:
965  extends:
966    - .stage-3
967    - .linux_test
968    # gcovr does not work on arm/linux
969    - .coverage-disable
970  tags:
971    - arch:arm
972    - os:linux
973  variables:
974    TEST_ARCH: arch-ci-linux-opt-arm
975
976linux-pkgs-64idx:
977  extends:
978    - .stage-3
979    - .linux_test
980  tags:
981    - gce-u22-stage3
982    - linux-mcpu
983  variables:
984    TEST_ARCH: arch-ci-linux-pkgs-64idx
985    LOAD_MODULES: intel-oneapi-mkl/2022.0.2
986
987linux-64idx-i8:
988  extends:
989    - .stage-3
990    - .linux_test
991  tags:
992    - gce-u22-stage3
993    - linux-mcpu
994  variables:
995    TEST_ARCH: arch-ci-linux-64idx-i8
996
997linux-gcc-ifc-cmplx:
998  extends:
999    - .stage-3
1000    - .linux_test_nofflags
1001  tags:
1002    - gce-u22-stage3
1003  variables:
1004    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
1005    LOAD_MODULES: intel-oneapi-compilers/2022.2.1
1006
1007linux-opt-cxx-quad:
1008  extends:
1009    - .stage-3
1010    - .linux_test
1011  tags:
1012    - gce-u22-stage3
1013  variables:
1014    TEST_ARCH: arch-ci-linux-opt-cxx-quad
1015    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
1016    LOAD_MODULES: python/3.13.0rc1-rayc5m7
1017
1018linux-ILP64:
1019  extends:
1020    - .stage-3
1021    - .linux_test
1022  tags:
1023    - gce-u22-stage3
1024  variables:
1025    TEST_ARCH: arch-ci-linux-ILP64
1026    LOAD_MODULES: gcc/8.5.0 mpich/2-1.5-gcc-8.5.0
1027    MAKE_CFLAGS: -Wno-discarded-qualifiers -Werror
1028
1029linux-64idx-i8-uni:
1030  extends:
1031    - .stage-3
1032    - .linux_test
1033  tags:
1034    - gce-u22-stage3
1035    - linux-mcpu
1036  variables:
1037    TEST_ARCH: arch-ci-linux-64idx-i8-uni
1038
1039linux-misc-32bit:
1040  extends:
1041    - .stage-3
1042    - .linux_test
1043  tags:
1044    - gce-u22-stage3
1045  variables:
1046    TEST_ARCH: arch-ci-linux-misc-32bit
1047
1048mswin-intel-cxx-cmplx:
1049  extends:
1050    - .stage-3
1051    - .mswin_test
1052  tags:
1053    - mswin-stage3
1054  variables:
1055    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
1056    TIMEOUT: 150
1057
1058mswin-uni:
1059  extends:
1060    - .stage-3
1061    - .mswin_test
1062  tags:
1063    - mswin-stage3
1064  variables:
1065    EXTRA_OPTIONS_INITIAL: -check_pointer_intensity 0 -error_output_stdout
1066    TEST_ARCH: arch-ci-mswin-uni
1067
1068mswin-gnu:
1069  extends:
1070    - .stage-3
1071    - .mswin_test
1072  tags:
1073    - mswin-stage3
1074  variables:
1075    TEST_ARCH: arch-ci-mswin-gnu
1076    MAKE_CFLAGS: -Werror
1077    MAKE_CXXFLAGS: -Werror
1078    MAKE_FFLAGS: -Werror
1079    DISABLE_TESTS: 1
1080
1081#mswin-intel:
1082#  extends:
1083#    - .stage-3
1084#    - .mswin_test
1085#  tags:
1086#    - os:win
1087#  variables:
1088#    TEST_ARCH: arch-ci-mswin-intel
1089
1090macos-cxx-cmplx-pkgs-dbg-arm:
1091  extends:
1092    - .stage-3
1093    - .macos_test
1094    - .coverage-disable
1095  tags:
1096    - os:macos-arm
1097  variables:
1098    TEST_ARCH: arch-ci-macos-cxx-cmplx-pkgs-dbg-arm
1099    INIT_SCRIPT: .zprofile
1100
1101macos-cxx-pkgs-opt-arm:
1102  extends:
1103    - .stage-3
1104    - .macos_test
1105    - .coverage-disable
1106  tags:
1107    - os:macos-arm
1108  variables:
1109    EXTRA_OPTIONS_INITIAL: -vecscatter_mpi1 false -options_left false
1110    TEST_ARCH: arch-ci-macos-cxx-pkgs-opt-arm
1111    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
1112    INIT_SCRIPT: .zprofile
1113
1114macos-dbg:
1115  extends:
1116    - .stage-3
1117    - .macos_test
1118    - .coverage-disable
1119  tags:
1120    - os:macos-x64
1121  variables:
1122    TEST_ARCH: arch-ci-macos-dbg
1123    ASAN_OPTIONS: log_path=stdout
1124    INIT_SCRIPT: .zprofile
1125
1126macos-opt-arm:
1127  extends:
1128    - .stage-3
1129    - .macos_test
1130    - .coverage-disable
1131  tags:
1132    - os:macos-arm
1133  variables:
1134    TEST_ARCH: arch-ci-macos-opt-arm
1135    INIT_SCRIPT: .zprofile
1136
1137# job for analyzing the coverage results and generating the various reports
1138coverage-analyze:
1139  extends: .test
1140  stage: stage-4
1141  tags:
1142    - gce-u22-short
1143  dependencies:
1144    # stage-2
1145    - linux-gcc-quad-64idx-dbg
1146    - linux-gcc-pkgs-opt
1147    - linux-gcc-complex-opt-32bit
1148    # stage-3
1149    - linux-pkgs-dbg
1150    - linux-matlab-ilp64
1151    - linux-cuda-pkgs
1152    - linux-cxx-cmplx-pkgs-64idx
1153    - linux-cuda-cmplx
1154    - linux-cuda-double-64idx
1155    - linux-cuda-uni-pkgs
1156    - linux-viennacl
1157    - linux-without-fc
1158    - linux-gcc-cxx-avx2
1159    - linux-clang-avx
1160    - linux-pkgs-cxx-mlib
1161    - linux-pkgs-valgrind
1162    - linux-misc-dbg
1163    - linux-pkgs-64idx
1164    - linux-pkgs-opt
1165    - linux-64idx-i8
1166    - linux-gcc-ifc-cmplx
1167    - linux-opt-cxx-quad
1168    - linux-ILP64
1169    - linux-64idx-i8-uni
1170  variables:
1171    PYTHON: python3
1172    PETSC_ARCH: arch-ci-analyze-pipeline
1173  before_script:
1174    - date
1175    - hostname
1176  script:
1177    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1178    - ${PYTHON} --version
1179    - gcovr --version
1180    - printf "PATH:$PATH\n"
1181    - printf "PYTHONPATH:$PYTHONPATH\n"
1182    - 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
1183    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1184    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1185  coverage: /^\s*lines:\s*\d+.\d+\%/
1186  artifacts:
1187    name: "$CI_JOB_NAME"
1188    when: always
1189    paths:
1190      - arch-ci-analyze-pipeline/gcovr/*
1191      - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1192    expire_in: 4 days
1193    reports:
1194      coverage_report:
1195        coverage_format: cobertura
1196        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1197
1198# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1199# environments from one job...
1200.coverage-review:
1201  extends: .test
1202  stage: .post
1203  tags:
1204    - gce-u22-short
1205  dependencies:
1206    - coverage-analyze
1207  script:
1208    - date
1209    - hostname
1210  artifacts:
1211    name: "$CI_JOB_NAME"
1212    when: always
1213    paths:
1214      - arch-ci-analyze-pipeline/gcovr/*
1215      - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1216    expire_in: 4 days
1217
1218coverage-total-review:
1219  extends: .coverage-review
1220  environment:
1221    name: coverage/all/$CI_COMMIT_REF_SLUG
1222    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html/report.html
1223    auto_stop_in: one week
1224    deployment_tier: testing
1225
1226coverage-untested-review:
1227  extends: .coverage-review
1228  environment:
1229    name: coverage/untested/$CI_COMMIT_REF_SLUG
1230    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/arch-ci-analyze-pipeline/gcovr/html_untested/report_untested.html
1231    auto_stop_in: one week
1232    deployment_tier: testing
1233
1234analyze-pipeline:
1235  extends: .coverage-review
1236  script:
1237    - date
1238    - hostname
1239    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1240    # pipeline should fail
1241    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1242      cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1243      exit 1;
1244      fi
1245  allow_failure: true
1246
1247#
1248# Base job for a documentation build (runs in venv to allow installing additional packages without root)
1249#
1250.docs:
1251  stage: stage-2
1252  tags:
1253    - gce-u24-docs
1254  before_script:
1255    - git fetch --unshallow --tags origin +release:remotes/origin/release +main:remotes/origin/main
1256    - printf "PATH:$PATH\n"
1257    - printf "PYTHONPATH:$PYTHONPATH\n"
1258    - VENV=venv-petsc-docs &&
1259      python3 -m venv $VENV &&
1260      . $VENV/bin/activate &&
1261      cd doc &&
1262      python -m pip install -r requirements.txt
1263
1264#
1265# Build documentation and make available for review using GitLab pages
1266#
1267docs-review:
1268  extends:
1269    - .docs
1270    - .test-basic
1271  script:
1272    - printf "PATH:$PATH\n"
1273    - printf "PYTHONPATH:$PYTHONPATH\n"
1274    #- printf "python:${PYTHON}\n"
1275    #- ${PYTHON} -m pip list --user
1276    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
1277    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
1278    - 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
1279    - (time make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1280    - (time make latexpdf SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1281    - cp _build/latex/manual.pdf ../public/html/manual/
1282  environment:
1283    name: review/$CI_COMMIT_REF_NAME
1284    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1285    auto_stop_in: one week
1286    deployment_tier: development
1287  artifacts:
1288    paths:
1289      - public
1290    expire_in: 4 days
1291  except:
1292    variables:
1293      - $PETSC_CI_SCHEDULED =~ /yes/
1294
1295#
1296# Deploy documentation using GitLab pages
1297#
1298pages: # this job name has special meaning to GitLab
1299  extends: .docs
1300  interruptible: true
1301  script:
1302    - mkdir -p ../public/ && cp public/* ../public/
1303    - (git checkout origin/main && pip install -r requirements.txt && make website-deploy SPHINXOPTS="-j 1" BUILDDIR="../public/main" && make latexpdf && mkdir -p ../public/main/manual && cp _build/latex/manual.pdf ../public/main/manual/) || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1304    - cd .. && git clean -fdxq -e public -e venv-petsc-docs && cd doc && rm -rf images
1305    - (git checkout origin/release && pip install -r requirements.txt && make website-deploy SPHINXOPTS="-j 1" BUILDDIR="../public/release" && make latexpdf && mkdir -p ../public/release/manual && cp _build/latex/manual.pdf ../public/release/manual/) || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1306    - rm -rf ../public/*/.doctrees
1307  only:
1308    variables:
1309      - $PETSC_CI_SCHEDULED == "yes"
1310  artifacts:
1311    paths:
1312      - public
1313    expire_in: 4 days
1314
1315#
1316#
1317# The following tests are experimental; more tests by users at other sites may be added below this. Experimental test
1318# that fail produce a warning, but do not block execution of a pipeline.
1319#
1320
1321.test-experimental:
1322  extends: .test
1323  allow_failure: true
1324