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