xref: /petsc/.gitlab-ci.yml (revision badd099fb2ece77d080fc02aefe95d4a02e75697)
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-x=0 --with-bison=0 --with-cmake=0 --with-pthread=0 --with-regex=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-11
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    TEST_OPTS: -j3 queryval='cuda,device,hypre,kokkos,kokkos_kernels,vec*' query='requires,requires,requires,requires,requires%OR%name'
604    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
605    OMP_PROC_BIND: false
606
607linux-kokkos-cuda:
608  extends:
609    - .stage-3
610    - .linux_test
611  tags:
612    - cuda-stage3
613  variables:
614    TEST_ARCH: arch-ci-linux-kokkos-cuda
615    TEST_OPTS: -j3 queryval='cuda,kokkos,kokkos_kernels' query='requires,requires,requires'
616    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
617    OMP_PROC_BIND: false
618    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-11-27-cuda/modules/linux-ubuntu22.04-x86_64/Core
619    LOAD_MODULES: cuda/12.8.0-rz6425d
620
621linux-cuda112-omp:
622  extends:
623    - .stage-3
624    - .linux_test
625    - .coverage-disable
626  tags:
627    - cuda-stage3
628  variables:
629    TEST_ARCH: arch-ci-linux-cuda112-omp
630    TEST_OPTS: -j4 query=requires queryval=kokkos_kernels
631    LOAD_MODULES: cuda/11.2.2 u-gcc-9/9.4.0
632    OMP_PROC_BIND: "false"
633    OMP_NUM_THREADS: 1
634    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
635
636linux-cuda-cmplx:
637  extends:
638    - .stage-3
639    - .linux_test
640  tags:
641    - cuda-stage3
642  variables:
643    TEST_ARCH: arch-ci-linux-cuda-cmplx
644    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
645
646linux-cuda-double-64idx:
647  extends:
648    - .stage-3
649    - .linux_test
650  tags:
651    - cuda12
652  variables:
653    TEST_ARCH: arch-ci-linux-cuda-double-64idx
654    TEST_OPTS: -j3 query=requires queryval=cuda
655    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
656
657linux-cuda-latest:
658  extends:
659    - .stage-3
660    - .linux_test
661  tags:
662    - cuda13
663  variables:
664    TEST_ARCH: arch-ci-linux-cuda-latest
665    TEST_OPTS: -j3 query=requires queryval=cuda
666    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
667
668linux-cuda-single-cxx:
669  extends:
670    - .stage-3
671    - .linux_test_noflags
672    - .coverage-disable
673  tags:
674    - cuda-stage3
675  variables:
676    TEST_ARCH: arch-ci-linux-cuda-single-cxx
677    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
678    LOAD_MODULES: nvhpc-22.11-gcc-11.3.0-vmvmbrx
679    TEST_OPTS: -j15 query=requires queryval=cuda
680
681linux-cuda-uni-pkgs:
682  extends:
683    - .stage-3
684    - .linux_test
685  tags:
686    - cuda-stage3
687  variables:
688    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
689    TEST_OPTS: -j20 query=requires queryval=cuda
690    MAKE_CUDAFLAGS: --compiler-options -Wall,-Werror
691
692linux-clang-cuda:
693  extends:
694    - .stage-3
695    - .linux_test
696    - .coverage-disable
697  tags:
698    - cuda-stage3
699  variables:
700    TEST_ARCH: arch-ci-linux-clang-cuda
701    TEST_OPTS: -j 1 queryval='cuda,snes*' query='requires%OR%name'
702    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2023-02-02/share/spack/modules/linux-ubuntu22.04-ivybridge
703    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
704    MAKE_CUDAFLAGS: -Wno-pass-failed -Werror
705
706linux-viennacl:
707  extends:
708    - .stage-3
709    - .linux_test
710  tags:
711    - cuda-stage3
712  variables:
713    TEST_ARCH: arch-ci-linux-viennacl
714    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
715    TEST_OPTS: -j20 query=requires queryval=viennacl
716
717linux-without-fc:
718  extends:
719    - .stage-3
720    - .linux_test
721  tags:
722    - gce-u22-stage3
723  variables:
724    TEST_ARCH: arch-ci-linux-without-fc
725
726linux-flang-arm:
727  extends:
728    - .stage-3
729    - .linux_test_noflags
730    # gcovr does not work on arm/linux
731    - .coverage-disable
732  tags:
733    - arch:arm
734    - os:linux
735  variables:
736    TEST_ARCH: arch-ci-linux-flang-arm
737
738linux-cmplx-single-arm:
739  extends:
740    - .stage-3
741    - .linux_test
742    # gcovr does not work on arm/linux
743    - .coverage-disable
744  tags:
745    - arch:arm
746    - os:linux
747  variables:
748    FLEXIBLAS: netlib
749    TEST_ARCH: arch-ci-linux-cmplx-single-arm
750
751linux-gcc-cxx-avx2:
752  extends:
753    - .stage-3
754    - .linux_test
755  tags:
756    - name:petsc-knl-01
757  variables:
758    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
759
760linux-clang-avx:
761  extends:
762    - .stage-3
763    - .linux_test
764  tags:
765    - name:petsc-knl-01
766  variables:
767    TEST_ARCH: arch-ci-linux-clang-avx
768
769linux-knl:
770  extends:
771    - .stage-3
772    - .linux_test
773    - .coverage-disable
774  tags:
775    - name:petsc-knl-01
776  variables:
777    MAKE_FFLAGS: -warn errors
778    TEST_ARCH: arch-ci-linux-knl
779    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
780
781linux-intel-mkl-single:
782  extends:
783    - .stage-3
784    - .linux_test_nofflags
785    - .coverage-disable
786  tags:
787    - name:petsc-knl-01
788  variables:
789    TEST_ARCH: arch-ci-linux-intel-mkl-single
790    LOAD_MODULES: intel-oneapi-compilers/2022.0.2 intel-oneapi-mkl/2022.0.2 intel-oneapi-mpi/2021.5.1
791
792linux-cxx-cmplx-pkgs-64idx:
793  extends:
794    - .stage-3
795    - .linux_test
796  tags:
797    - gce-u22-stage3
798  variables:
799    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
800    EXTRA_OPTIONS_INITIAL: -fp_trap
801    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
802    LOAD_MODULES: python/3.13.0rc1-rayc5m7 py-setuptools/69.2.0-6yku3zk python-venv/1.0-bnbfk2n py-pip/23.1.2-o7dlzno
803
804# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
805linux-pkgs-dbg-ftn-interfaces:
806  extends:
807    - .stage-3
808    - .linux_test
809    - .coverage-disable
810  tags:
811    - gce-u22-stage3
812  variables:
813    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
814    OMP_PROC_BIND: "false"
815    OMP_NUM_THREADS: 4
816    EXTRA_OPTIONS_INITIAL: -fp_trap
817
818linux-pkgs-cxx-mlib:
819  extends:
820    - .stage-3
821    - .linux_test
822  tags:
823    - gce-u22-stage3
824  variables:
825    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
826    EXTRA_OPTIONS_INITIAL: -fp_trap
827    LOAD_MODULES: python/3.8.13
828
829linux-pkgs-valgrind:
830  extends:
831    - .stage-3
832    - .linux_test
833  tags:
834    - gce-valgrind
835  variables:
836    TEST_ARCH: arch-ci-linux-pkgs-valgrind
837    TIMEOUT: 1200
838    UCX_SYSV_HUGETLB_MODE: n
839
840linux-pkgs-opt:
841  extends:
842    - .stage-3
843    - .linux_test
844  tags:
845    - gce-u22-stage3
846    - linux-fast
847  variables:
848    TEST_ARCH: arch-ci-linux-pkgs-opt
849    LOAD_MODULES: gcc/12.1.0
850    MAKE_CFLAGS: -Wno-unused-const-variable -Werror
851    MAKE_CXXFLAGS: -Wno-deprecated-declarations -Werror
852    MPI4PY_BUILD_PYSABI: 1
853    PETSC4PY_BUILD_PYSABI: 1
854    SLEPC4PY_BUILD_PYSABI: 1
855
856linux-pkgs-dbg:
857  extends:
858    - .stage-3
859    - .linux_test
860  tags:
861    - gce-u22-stage3
862    - linux-gcov
863  variables:
864    TEST_ARCH: arch-ci-linux-pkgs-dbg
865    EXTRA_OPTIONS_INITIAL: -fp_trap
866
867linux-matlab-ilp64:
868  extends:
869    - .stage-3
870    - .linux_test
871  tags:
872    - gce-u22-stage3
873    - linux-gcov
874  variables:
875    TEST_ARCH: arch-ci-linux-matlab-ilp64
876    LOAD_MODULES: gcc/9.4.0 matlab/R2022a
877  allow_failure: true
878
879linux-intel-cmplx:
880  extends:
881    - .stage-3
882    - .linux_test_nofflags
883    - .coverage-disable
884  tags:
885    - gce-u22-stage3
886  variables:
887    TEST_ARCH: arch-ci-linux-intel-cmplx
888    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
889
890linux-misc-dbg:
891  extends:
892    - .stage-3
893    - .linux_test
894  tags:
895    - gce-u22-stage3
896  variables:
897    TEST_ARCH: arch-ci-linux-misc-dbg
898    LOAD_MODULES: gcc/12.1.0
899
900check-each-commit:
901  extends:
902    - .stage-2
903    - .linux_test
904    - .coverage-disable
905  tags:
906    - gce-u22-stage2
907  script:
908    - 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
909    - lib/petsc/bin/maint/check-each-commit.sh
910  except:
911    variables:
912      - $PETSC_CI_SCHEDULED =~ /yes/
913  allow_failure: true
914
915linux-analyzer:
916  extends:
917    - .stage-2
918    - .linux_test
919    - .coverage-disable
920  tags:
921    - gce-u22-stage2
922  script:
923    - printf "PATH:$PATH\n"
924    - printf "PYTHONPATH:$PYTHONPATH\n"
925    - python3 --version
926    - git --version
927    - mypy --version
928    - vermin --version
929    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
930    - 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
931    - printf "./config/examples/${TEST_ARCH}.py\n"
932    - cat ./config/examples/${TEST_ARCH}.py
933    - ./config/examples/${TEST_ARCH}.py
934    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
935    - make V=3 LINTER_OPTIONS="${LINTER_OPTIONS} -- ./src" lint
936  variables:
937    TEST_ARCH: arch-ci-linux-analyzer
938    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --werror 1"
939  artifacts:
940    paths:
941      - arch-*/lib/petsc/conf/*.log
942      - ./petscLintPatches/*.patch
943    expire_in: 4 days
944  except:
945    variables:
946      - $PETSC_CI_SCHEDULED =~ /yes/
947
948linux-intel:
949  extends:
950    - .stage-3
951    - .linux_test_nofflags
952    - .coverage-disable
953  tags:
954    - gce-u22-stage3
955  variables:
956    TEST_ARCH: arch-ci-linux-intel
957    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
958
959linux-clang-ubsan:
960  extends:
961    - .stage-2
962    - .linux_test
963    - .coverage-disable
964  tags:
965    - gce-u22-stage2
966  variables:
967    TEST_ARCH: arch-ci-linux-clang-ubsan
968    LOAD_MODULES: llvm/17.0.4
969
970linux-opt-arm:
971  extends:
972    - .stage-3
973    - .linux_test
974    # gcovr does not work on arm/linux
975    - .coverage-disable
976  tags:
977    - arch:arm
978    - os:linux
979  variables:
980    TEST_ARCH: arch-ci-linux-opt-arm
981
982linux-pkgs-64idx:
983  extends:
984    - .stage-3
985    - .linux_test
986  tags:
987    - gce-u22-stage3
988    - linux-mcpu
989  variables:
990    TEST_ARCH: arch-ci-linux-pkgs-64idx
991    LOAD_MODULES: intel-oneapi-mkl/2022.0.2
992
993linux-64idx-i8:
994  extends:
995    - .stage-3
996    - .linux_test
997  tags:
998    - gce-u22-stage3
999    - linux-mcpu
1000  variables:
1001    TEST_ARCH: arch-ci-linux-64idx-i8
1002
1003linux-gcc-ifc-cmplx:
1004  extends:
1005    - .stage-3
1006    - .linux_test_nofflags
1007  tags:
1008    - gce-u22-stage3
1009  variables:
1010    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
1011    LOAD_MODULES: intel-oneapi-compilers/2022.2.1
1012
1013linux-opt-cxx-quad:
1014  extends:
1015    - .stage-3
1016    - .linux_test
1017  tags:
1018    - gce-u22-stage3
1019  variables:
1020    TEST_ARCH: arch-ci-linux-opt-cxx-quad
1021    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
1022    LOAD_MODULES: python/3.13.0rc1-rayc5m7
1023
1024linux-ILP64:
1025  extends:
1026    - .stage-3
1027    - .linux_test
1028  tags:
1029    - gce-u22-stage3
1030  variables:
1031    TEST_ARCH: arch-ci-linux-ILP64
1032    LOAD_MODULES: gcc/8.5.0 mpich/2-1.5-gcc-8.5.0
1033    MAKE_CFLAGS: -Wno-discarded-qualifiers -Werror
1034
1035linux-64idx-i8-uni:
1036  extends:
1037    - .stage-3
1038    - .linux_test
1039  tags:
1040    - gce-u22-stage3
1041    - linux-mcpu
1042  variables:
1043    TEST_ARCH: arch-ci-linux-64idx-i8-uni
1044
1045linux-misc-32bit:
1046  extends:
1047    - .stage-3
1048    - .linux_test
1049  tags:
1050    - gce-u22-stage3
1051  variables:
1052    TEST_ARCH: arch-ci-linux-misc-32bit
1053
1054mswin-intel-cxx-cmplx:
1055  extends:
1056    - .stage-3
1057    - .mswin_test
1058  tags:
1059    - mswin-11
1060  variables:
1061    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
1062    TIMEOUT: 150
1063    MAKE_CFLAGS: -Wno-string-compare -Wno-deprecated-declarations
1064    MAKE_CXXFLAGS: -Wno-string-compare -Wno-deprecated-declarations -Wno-unused-command-line-argument
1065
1066mswin-uni:
1067  extends:
1068    - .stage-3
1069    - .mswin_test
1070  tags:
1071    - mswin-11
1072  variables:
1073    EXTRA_OPTIONS_INITIAL: -check_pointer_intensity 0 -error_output_stdout
1074    TEST_ARCH: arch-ci-mswin-uni
1075
1076mswin-gnu:
1077  extends:
1078    - .stage-3
1079    - .mswin_test
1080  tags:
1081    - mswin-11
1082  variables:
1083    TEST_ARCH: arch-ci-mswin-gnu
1084    MAKE_CFLAGS: -Werror
1085    MAKE_CXXFLAGS: -Werror
1086    MAKE_FFLAGS: -Werror
1087    DISABLE_TESTS: 1
1088
1089#mswin-intel:
1090#  extends:
1091#    - .stage-3
1092#    - .mswin_test
1093#  tags:
1094#    - os:win
1095#  variables:
1096#    TEST_ARCH: arch-ci-mswin-intel
1097
1098macos-cxx-cmplx-pkgs-dbg-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-cxx-cmplx-pkgs-dbg-arm
1107    INIT_SCRIPT: .zprofile
1108
1109macos-cxx-pkgs-opt-arm:
1110  extends:
1111    - .stage-3
1112    - .macos_test
1113    - .coverage-disable
1114  tags:
1115    - os:macos-arm
1116  variables:
1117    EXTRA_OPTIONS_INITIAL: -vecscatter_mpi1 false -options_left false
1118    TEST_ARCH: arch-ci-macos-cxx-pkgs-opt-arm
1119    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
1120    INIT_SCRIPT: .zprofile
1121
1122macos-dbg:
1123  extends:
1124    - .stage-3
1125    - .macos_test
1126    - .coverage-disable
1127  tags:
1128    - os:macos-x64
1129  variables:
1130    TEST_ARCH: arch-ci-macos-dbg
1131    ASAN_OPTIONS: log_path=stdout
1132    INIT_SCRIPT: .zprofile
1133
1134macos-opt-arm:
1135  extends:
1136    - .stage-3
1137    - .macos_test
1138    - .coverage-disable
1139  tags:
1140    - os:macos-arm
1141  variables:
1142    TEST_ARCH: arch-ci-macos-opt-arm
1143    INIT_SCRIPT: .zprofile
1144
1145# job for analyzing the coverage results and generating the various reports
1146coverage-analyze:
1147  extends: .test
1148  stage: stage-4
1149  tags:
1150    - gce-u22-short
1151  dependencies:
1152    # stage-2
1153    - linux-gcc-quad-64idx-dbg
1154    - linux-gcc-pkgs-opt
1155    - linux-gcc-complex-opt-32bit
1156    # stage-3
1157    - linux-pkgs-dbg
1158    - linux-matlab-ilp64
1159    - linux-cuda-pkgs
1160    - linux-cxx-cmplx-pkgs-64idx
1161    - linux-cuda-cmplx
1162    - linux-cuda-double-64idx
1163    - linux-cuda-uni-pkgs
1164    - linux-viennacl
1165    - linux-without-fc
1166    - linux-gcc-cxx-avx2
1167    - linux-clang-avx
1168    - linux-pkgs-cxx-mlib
1169    - linux-pkgs-valgrind
1170    - linux-misc-dbg
1171    - linux-pkgs-64idx
1172    - linux-pkgs-opt
1173    - linux-64idx-i8
1174    - linux-gcc-ifc-cmplx
1175    - linux-opt-cxx-quad
1176    - linux-ILP64
1177    - linux-64idx-i8-uni
1178  variables:
1179    PYTHON: python3
1180    PETSC_ARCH: arch-ci-analyze-pipeline
1181  before_script:
1182    - date
1183    - hostname
1184  script:
1185    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1186    - ${PYTHON} --version
1187    - gcovr --version
1188    - printf "PATH:$PATH\n"
1189    - printf "PYTHONPATH:$PYTHONPATH\n"
1190    - 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
1191    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1192    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1193  coverage: /^\s*lines:\s*\d+.\d+\%/
1194  artifacts:
1195    name: "$CI_JOB_NAME"
1196    when: always
1197    paths:
1198      - arch-ci-analyze-pipeline/gcovr/*
1199      - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1200    expire_in: 4 days
1201    reports:
1202      coverage_report:
1203        coverage_format: cobertura
1204        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1205
1206# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1207# environments from one job...
1208.coverage-review:
1209  extends: .test
1210  stage: .post
1211  tags:
1212    - gce-u22-short
1213  dependencies:
1214    - coverage-analyze
1215  script:
1216    - date
1217    - hostname
1218  artifacts:
1219    name: "$CI_JOB_NAME"
1220    when: always
1221    paths:
1222      - arch-ci-analyze-pipeline/gcovr/*
1223      - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1224    expire_in: 4 days
1225
1226coverage-total-review:
1227  extends: .coverage-review
1228  environment:
1229    name: coverage/all/$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/report.html
1231    auto_stop_in: one week
1232    deployment_tier: testing
1233
1234coverage-untested-review:
1235  extends: .coverage-review
1236  environment:
1237    name: coverage/untested/$CI_COMMIT_REF_SLUG
1238    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
1239    auto_stop_in: one week
1240    deployment_tier: testing
1241
1242analyze-pipeline:
1243  extends: .coverage-review
1244  script:
1245    - date
1246    - hostname
1247    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1248    # pipeline should fail
1249    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1250      cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1251      exit 1;
1252      fi
1253  allow_failure: true
1254
1255#
1256# Base job for a documentation build (runs in venv to allow installing additional packages without root)
1257#
1258.docs:
1259  stage: stage-2
1260  tags:
1261    - gce-u24-docs
1262  before_script:
1263    - git fetch --unshallow --tags origin +release:remotes/origin/release +main:remotes/origin/main
1264    - printf "PATH:$PATH\n"
1265    - printf "PYTHONPATH:$PYTHONPATH\n"
1266    - VENV=venv-petsc-docs &&
1267      python3 -m venv $VENV &&
1268      . $VENV/bin/activate &&
1269      cd doc &&
1270      python -m pip install -r requirements.txt
1271
1272#
1273# Build documentation and make available for review using GitLab pages
1274#
1275docs-review:
1276  extends:
1277    - .docs
1278    - .test-basic
1279  script:
1280    - printf "PATH:$PATH\n"
1281    - printf "PYTHONPATH:$PYTHONPATH\n"
1282    #- printf "python:${PYTHON}\n"
1283    #- ${PYTHON} -m pip list --user
1284    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
1285    - printf "EXTRA_OPTIONS_INITIAL:$EXTRA_OPTIONS_INITIAL $BASE_EXTRA_OPTIONS\n"
1286    - 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
1287    - (time make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1288    - (time make latexpdf SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1289    - cp _build/latex/manual.pdf ../public/html/manual/
1290  environment:
1291    name: review/$CI_COMMIT_REF_NAME
1292    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1293    auto_stop_in: one week
1294    deployment_tier: development
1295  artifacts:
1296    paths:
1297      - public
1298    expire_in: 4 days
1299  except:
1300    variables:
1301      - $PETSC_CI_SCHEDULED =~ /yes/
1302
1303#
1304# Deploy documentation using GitLab pages
1305#
1306pages: # this job name has special meaning to GitLab
1307  extends: .docs
1308  interruptible: true
1309  script:
1310    - mkdir -p ../public/ && cp public/* ../public/
1311    - (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)
1312    - cd .. && git clean -fdxq -e public -e venv-petsc-docs && cd doc && rm -rf images
1313    - (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)
1314    - rm -rf ../public/*/.doctrees
1315  only:
1316    variables:
1317      - $PETSC_CI_SCHEDULED == "yes"
1318  artifacts:
1319    paths:
1320      - public
1321    expire_in: 4 days
1322
1323#
1324#
1325# The following tests are experimental; more tests by users at other sites may be added below this. Experimental test
1326# that fail produce a warning, but do not block execution of a pipeline.
1327#
1328
1329.test-experimental:
1330  extends: .test
1331  allow_failure: true
1332