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