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