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