xref: /petsc/.gitlab-ci.yml (revision 2b943f9f236934bbb39d518b294ea589c84d2c44)
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    LOAD_MODULES: nvhpc/22.3
818
819# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
820linux-nagfor:
821  extends:
822    - .stage-3
823    - .linux_test_nofflags
824  tags:
825    - gce-stage2, linux-mcpu
826  variables:
827    LOAD_MODULES: nag/6.1
828    TEST_ARCH: arch-ci-linux-nagfor
829  allow_failure:
830    exit_codes: 126
831
832linux-intel-cmplx:
833  extends:
834    - .stage-3
835    - .linux_test_nofflags
836    - .coverage-disable
837  tags:
838    - gce-u22-stage3
839  variables:
840    TEST_ARCH: arch-ci-linux-intel-cmplx
841    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
842
843linux-xsdk-dbg:
844  extends:
845    - .stage-3
846    - .linux_test
847  tags:
848    - gce-u22-stage3
849  variables:
850    TEST_ARCH: arch-ci-linux-xsdk-dbg
851    LOAD_MODULES: gcc/12.1.0
852
853check-each-commit:
854  extends:
855    - .stage-2
856    - .linux_test
857    - .coverage-disable
858  tags:
859    - gce-u22-stage2
860  script:
861    - 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
862    - lib/petsc/bin/maint/check-each-commit.sh
863  except:
864    variables:
865      - $PETSC_CI_SCHEDULED =~ /yes/
866  allow_failure: true
867
868linux-analyzer:
869  extends:
870    - .stage-2
871    - .linux_test
872    - .coverage-disable
873  tags:
874    - gce-u22-stage2
875  script:
876    - printf "PATH:$PATH\n"
877    - printf "PYTHONPATH:$PYTHONPATH\n"
878    - python3 --version
879    - git --version
880    - mypy --version
881    - vermin --version
882    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
883    - 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
884    - printf "./config/examples/${TEST_ARCH}.py\n"
885    - cat ./config/examples/${TEST_ARCH}.py
886    - ./config/examples/${TEST_ARCH}.py
887    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
888    - make V=3 LINTER_OPTIONS="${LINTER_OPTIONS} -- ./src" lint
889  variables:
890    TEST_ARCH: arch-ci-linux-analyzer
891    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config-14 --libdir`/libclang.so.1 --werror 1"
892  artifacts:
893    paths:
894    - arch-*/lib/petsc/conf/*.log
895    - ./petscLintPatches/*.patch
896    expire_in: 4 days
897  except:
898    variables:
899      - $PETSC_CI_SCHEDULED =~ /yes/
900
901linux-intel:
902  extends:
903    - .stage-3
904    - .linux_test_nofflags
905    - .coverage-disable
906  tags:
907    - gce-u22-stage3
908  variables:
909    TEST_ARCH: arch-ci-linux-intel
910    LOAD_MODULES: intel-oneapi-compilers/2023.0.0 intel-oneapi-mkl/2022.0.2
911
912linux-clang-ubsan:
913  extends:
914    - .stage-2
915    - .linux_test
916    - .coverage-disable
917  tags:
918    - gce-u22-stage2
919  variables:
920    TEST_ARCH: arch-ci-linux-clang-ubsan
921    LOAD_MODULES: llvm/17.0.4
922
923linux-opt-arm:
924  extends:
925    - .stage-3
926    - .linux_test
927    # gcovr does not work on arm/linux
928    - .coverage-disable
929  tags:
930    - arch:arm, os:linux
931  variables:
932    TEST_ARCH: arch-ci-linux-opt-arm
933
934linux-pkgs-64idx:
935  extends:
936    - .stage-3
937    - .linux_test
938  tags:
939    - gce-u22-stage3, linux-mcpu
940  variables:
941    TEST_ARCH: arch-ci-linux-pkgs-64idx
942    LOAD_MODULES: intel-oneapi-mkl/2022.0.2
943
944linux-64idx-i8:
945  extends:
946    - .stage-3
947    - .linux_test
948  tags:
949    - gce-u22-stage3, linux-mcpu
950  variables:
951    TEST_ARCH: arch-ci-linux-64idx-i8
952
953linux-gcc-ifc-cmplx:
954  extends:
955    - .stage-3
956    - .linux_test_nofflags
957  tags:
958    - gce-u22-stage3
959  variables:
960    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
961    LOAD_MODULES: intel-oneapi-compilers/2022.2.1
962
963linux-opt-cxx-quad:
964  extends:
965    - .stage-3
966    - .linux_test
967  tags:
968    - gce-u22-stage3
969  variables:
970    TEST_ARCH: arch-ci-linux-opt-cxx-quad
971    MODULEPATH: /nfs/gce/projects/petsc/soft/u22.04/spack-2024-08-30/modules/linux-ubuntu22.04-x86_64/Core
972    LOAD_MODULES: python/3.13.0rc1-rayc5m7
973
974linux-ILP64:
975  extends:
976    - .stage-3
977    - .linux_test
978  tags:
979    - gce-u22-stage3
980  variables:
981    TEST_ARCH: arch-ci-linux-ILP64
982    LOAD_MODULES: gcc/8.5.0 mpich/2-1.5-gcc-8.5.0
983    MAKE_CFLAGS: -Wno-discarded-qualifiers -Werror
984
985linux-64idx-i8-uni:
986  extends:
987    - .stage-3
988    - .linux_test
989  tags:
990    - gce-u22-stage3, linux-mcpu
991  variables:
992    TEST_ARCH: arch-ci-linux-64idx-i8-uni
993
994linux-misc-32bit:
995  extends:
996    - .stage-3
997    - .linux_test
998  tags:
999    - gce-u22-stage3
1000  variables:
1001    TEST_ARCH: arch-ci-linux-misc-32bit
1002
1003mswin-intel-cxx-cmplx:
1004  extends:
1005    - .stage-3
1006    - .mswin_test
1007  tags:
1008    - mswin-stage3
1009  variables:
1010    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
1011    TIMEOUT: 150
1012
1013mswin-uni:
1014  extends:
1015    - .stage-3
1016    - .mswin_test
1017  tags:
1018    - mswin-stage3
1019  variables:
1020    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout
1021    TEST_ARCH: arch-ci-mswin-uni
1022
1023mswin-gnu:
1024  extends:
1025    - .stage-3
1026    - .mswin_test
1027  tags:
1028    - mswin-stage3
1029  variables:
1030    TEST_ARCH: arch-ci-mswin-gnu
1031    MAKE_CFLAGS: -Werror
1032    MAKE_CXXFLAGS: -Werror
1033    MAKE_FFLAGS: -Werror
1034    DISABLE_TESTS: 1
1035
1036#mswin-intel:
1037#  extends:
1038#    - .stage-3
1039#    - .mswin_test
1040#  tags:
1041#    - os:win
1042#  variables:
1043#    TEST_ARCH: arch-ci-mswin-intel
1044
1045osx-cxx-cmplx-pkgs-dbg:
1046  extends:
1047    - .stage-3
1048    - .osx_test
1049    - .coverage-disable
1050  tags:
1051    - os:macos-x64
1052  variables:
1053    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
1054    INIT_SCRIPT: .zprofile
1055
1056osx-cxx-pkgs-opt-arm:
1057  extends:
1058    - .stage-3
1059    - .osx_test
1060    - .coverage-disable
1061  tags:
1062    - os:macos-arm
1063  variables:
1064    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false
1065    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt-arm
1066    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
1067    INIT_SCRIPT: .zprofile
1068
1069osx-dbg:
1070  extends:
1071    - .stage-3
1072    - .osx_test
1073    - .coverage-disable
1074  tags:
1075    - os:macos-x64
1076  variables:
1077    TEST_ARCH: arch-ci-osx-dbg
1078    ASAN_OPTIONS: log_path=stdout
1079    INIT_SCRIPT: .zprofile
1080
1081osx-xsdk-opt:
1082  extends:
1083    - .stage-3
1084    - .osx_test
1085    - .coverage-disable
1086  tags:
1087    - os:macos-x64
1088  variables:
1089    TEST_ARCH: arch-ci-osx-xsdk-opt
1090    INIT_SCRIPT: .zprofile
1091
1092# job for analyzing the coverage results and generating the various reports
1093coverage-analyze:
1094  extends: .test
1095  stage: stage-4
1096  tags:
1097    - gce-u22-short
1098  dependencies:
1099    # stage-2
1100    - linux-gcc-quad-64idx-dbg
1101    - linux-gcc-pkgs-opt
1102    - linux-gcc-complex-opt-32bit
1103    # stage-3
1104    - linux-pkgs-dbg
1105    - linux-matlab-ilp64
1106    - linux-cuda-pkgs
1107    - linux-cxx-cmplx-pkgs-64idx
1108    - linux-cuda-cmplx
1109    - linux-cuda-double-64idx
1110    - linux-cuda-uni-pkgs
1111    - linux-viennacl
1112    - linux-without-fc
1113    - linux-gcc-cxx-avx2
1114    - linux-clang-avx
1115    - linux-pkgs-cxx-mlib
1116    - linux-pkgs-valgrind
1117    - linux-nagfor
1118    - linux-xsdk-dbg
1119    - linux-pkgs-64idx
1120    - linux-pkgs-opt
1121    - linux-64idx-i8
1122    - linux-gcc-ifc-cmplx
1123    - linux-opt-cxx-quad
1124    - linux-ILP64
1125    - linux-64idx-i8-uni
1126  variables:
1127    PYTHON: python3
1128    PETSC_ARCH: arch-ci-analyze-pipeline
1129  before_script:
1130    - date
1131    - hostname
1132  script:
1133    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
1134    - ${PYTHON} --version
1135    - gcovr --version
1136    - printf "PATH:$PATH\n"
1137    - printf "PYTHONPATH:$PYTHONPATH\n"
1138    - 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
1139    - ${PYTHON} ./configure --with-mpi=0 --with-cxx=0 --download-sowing --with-fortran-bindings
1140    - make mergegcov PETSC_GCOV_OPTIONS='--ci-mode --verbose'
1141  coverage: /^\s*lines:\s*\d+.\d+\%/
1142  artifacts:
1143    name: "$CI_JOB_NAME"
1144    when: always
1145    paths:
1146    - arch-ci-analyze-pipeline/gcovr/*
1147    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1148    expire_in: 4 days
1149    reports:
1150      coverage_report:
1151        coverage_format: cobertura
1152        path: arch-ci-analyze-pipeline/gcovr/xml/*.xml
1153
1154# template for the coverage review jobs, these must be separate jobs as you cannot deploy multiple
1155# environments from one job...
1156.coverage-review:
1157  extends: .test
1158  stage: .post
1159  tags:
1160    - gce-u22-short
1161  dependencies:
1162    - coverage-analyze
1163  script:
1164    - date
1165    - hostname
1166  artifacts:
1167    name: "$CI_JOB_NAME"
1168    when: always
1169    paths:
1170    - arch-ci-analyze-pipeline/gcovr/*
1171    - arch-ci-analyze-pipeline/lib/petsc/conf/*.log
1172    expire_in: 4 days
1173
1174coverage-total-review:
1175  extends: .coverage-review
1176  environment:
1177    name: coverage/all/$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/report.html
1179    auto_stop_in: one week
1180    deployment_tier: testing
1181
1182coverage-untested-review:
1183  extends: .coverage-review
1184  environment:
1185    name: coverage/untested/$CI_COMMIT_REF_SLUG
1186    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
1187    auto_stop_in: one week
1188    deployment_tier: testing
1189
1190analyze-pipeline:
1191  extends: .coverage-review
1192  script:
1193    - date
1194    - hostname
1195    # This file is created by lib/petsc/bin/maint/gcov.py. If it exists then the CI
1196    # pipeline should fail
1197    - if [ -f ./arch-ci-analyze-pipeline/gcovr/.CI_FAIL ]; then
1198        cat ./arch-ci-analyze-pipeline/gcovr/merge_gcov_errors.log;
1199        exit 1;
1200      fi
1201  allow_failure: true
1202
1203#
1204# Base job for a documentation build (runs in venv to allow installing additional packages without root)
1205#
1206.docs:
1207  stage: stage-2
1208  tags:
1209    - linux-docs
1210  before_script:
1211    - git fetch --unshallow --tags origin +release:remotes/origin/release +main:remotes/origin/main
1212    - module --trace load python-3.11.2-gcc-9.4.0-6p2ktlj
1213    - printf "PATH:$PATH\n"
1214    - printf "PYTHONPATH:$PYTHONPATH\n"
1215    - VENV=venv-petsc-docs &&
1216      python3 -m venv $VENV &&
1217      . $VENV/bin/activate &&
1218      cd doc &&
1219      python -m pip install -r requirements.txt
1220
1221#
1222# Build documentation and make available for review using GitLab pages
1223#
1224docs-review:
1225  extends:
1226    - .docs
1227    - .test-basic
1228  script:
1229    - printf "PATH:$PATH\n"
1230    - printf "PYTHONPATH:$PYTHONPATH\n"
1231    #- printf "python:${PYTHON}\n"
1232    #- ${PYTHON} -m pip list --user
1233    - printf "CONFIG_OPTS:${CONFIG_OPTS}\n"
1234    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
1235    - 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
1236    - (time make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1237    - (time make latexpdf SPHINXOPTS="-T -E -W --keep-going -j 2") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1238    - cp _build/latex/manual.pdf ../public/html/manual/
1239  environment:
1240    name: review/$CI_COMMIT_REF_NAME
1241    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1242    auto_stop_in: one week
1243    deployment_tier: development
1244  artifacts:
1245    paths:
1246      - public
1247    expire_in: 4 days
1248  except:
1249    variables:
1250      - $PETSC_CI_SCHEDULED =~ /yes/
1251
1252#
1253# Deploy documentation using GitLab pages
1254#
1255pages: # this job name has special meaning to GitLab
1256  extends: .docs
1257  interruptible: true
1258  script:
1259    - mkdir -p ../public/ && cp public/* ../public/
1260    - (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)
1261    - cd .. && git clean -fdxq -e public -e venv-petsc-docs && cd doc && rm -rf images
1262    - (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)
1263    - rm -rf ../public/*/.doctrees
1264  only:
1265    variables:
1266      - $PETSC_CI_SCHEDULED == "yes"
1267  artifacts:
1268    paths:
1269      - public
1270    expire_in: 4 days
1271
1272#
1273#
1274# The following tests are experimental; more tests by users at other sites may be added below this. Experimental test
1275# that fail produce a warning, but do not block execution of a pipeline.
1276#
1277
1278.test-experimental:
1279  extends: .test
1280  allow_failure: true
1281
1282