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