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