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