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