xref: /petsc/.gitlab-ci.yml (revision 6ffe77eaecce1557e50d00ca5347a7f48e598865)
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
16variables:
17  GIT_STRATEGY: fetch
18  GIT_CLEAN_FLAGS: -ffdxq
19  PETSC_OPTIONS: -checkstack
20  TIMEOUT: 450
21
22#
23# The most basic template that most tests will expand upon
24#
25
26.test-basic:
27  interruptible: true
28  only:
29    refs:
30#     Set with CI/CD Shedules - New Schedule
31      - schedules
32      - api
33#     Set with CI/CD Pipelines - Run Pipeline
34      - web
35      - merge_requests
36  dependencies: []
37
38.test:
39  extends: .test-basic
40  except:
41    variables:
42      # Skip if the docs-only label is attached to a merge request
43      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)docs-only($|,)/
44      - $PETSC_CI_SCHEDULED =~ /yes/
45
46check-ci-settings:
47  extends: .test-basic
48  stage: .pre
49  tags:
50    - gce-stage1
51  script:
52    - lib/petsc/bin/maint/check-ci-settings.sh
53#
54#  This provides the basic order of operations and options template for cloud based stage 1 tests.
55#  Not all test-short need to follow this template but most will.
56#
57
58.stage-1:
59  extends: .test
60  stage: stage-1
61  tags:
62    - gce-stage1
63  before_script:
64    - date
65    - hostname
66    - grep PRETTY_NAME /etc/os-release
67    - nproc
68    - lscpu
69    - ccache --zero-stats
70    - echo ${CONFIG_OPTS}
71  script:
72    - printf "PATH:$PATH\n"
73    - printf "PYTHONPATH:$PYTHONPATH\n"
74    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
75    - 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
76    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O3 -march=native' CXXOPTFLAGS='-O3 -march=native' FOPTFLAGS='-O3 -march=native' ${CONFIG_OPTS}
77    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
78    - make CFLAGS="${MAKE_TEST_CFLAGS}" CXXFLAGS="${MAKE_TEST_CXXFLAGS}" FFLAGS="${MAKE_TEST_FFLAGS}" allgtests-tap gmakesearch="${TEST_SEARCH}" TIMEOUT=${TIMEOUT}
79  variables:
80    PYTHON: python3
81    MAKE_CFLAGS: -Werror
82    MAKE_CXXFLAGS: -Werror -Wzero-as-null-pointer-constant
83    MAKE_FFLAGS: -Werror
84    MAKE_TEST_CFLAGS: -Werror
85    MAKE_TEST_CXXFLAGS: -Werror
86    MAKE_TEST_FFLAGS: -Werror
87  after_script:
88    - date
89    - ccache --show-stats
90  artifacts:
91    reports:
92      junit: arch-*/tests/testresults.xml
93    name: "$CI_JOB_NAME"
94    when: always
95    paths:
96    - arch-*/lib/petsc/conf/*.log
97    - arch-*/lib/pkgconfig/petsc.pc
98    - arch-*/tests/testresults.xml
99    - arch-*/tests/test_*_tap.log
100    - arch-*/tests/test_*_err.log
101    expire_in: 4 days
102
103#
104# The following tests run on the cloud as part of stage-1.
105#
106
107ompi-cuda:
108  extends: .stage-1
109  tags:
110  - stage1, name:p1
111  variables:
112    CONFIG_OPTS: --with-mpi-dir=/home/petsc/soft/openmpi-4.0.2-cuda --with-cuda=1 --with-fc=0
113    TEST_SEARCH: snes_tutorials-ex19_cuda%
114    MAKE_CXXFLAGS: -Werror
115
116mpich-cxx-py3:
117  extends: .stage-1
118  variables:
119    CONFIG_OPTS: --with-clanguage=cxx --with-fc=0 CXXFLAGS=-std=c++11
120    TEST_SEARCH: snes_tutorials-ex48%
121
122uni-complex-float-int64:
123  extends: .stage-1
124  variables:
125    CONFIG_OPTS: --with-mpi=0 --with-scalar-type=complex --with-precision=single --with-64-bit-indices
126    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
127
128c99-mlib-static-py:
129  extends: .stage-1
130  variables:
131    CONFIG_OPTS: --with-single-library=0 --with-shared-libraries=0 CFLAGS=-std=c99
132    TEST_SEARCH: snes_tutorials-ex19% snes_tutorials-ex5f90t%
133    MAKE_TEST_FFLAGS: -Werror -std=f2008
134
135petsc4py-install:
136  extends: .stage-2
137  tags:
138    - gce-stage2
139  variables:
140    PYTHON: python3
141    T_PREFIX: petsc-install
142    T_DESTDIR: petsc-destdir
143    T_PETSC4PY: src/binding/petsc4py
144    T_VALIDATE_CMD: lib/petsc/bin/maint/validate-petsc4py.sh
145  script:
146    - printf "PATH:$PATH\n"
147    - mkdir hide
148    - 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
149    - ${PYTHON} ./configure --prefix="${PWD}/${T_PREFIX}" --with-petsc4py=1 --with-debugging=0
150    - make CFLAGS=-Werror CXXFLAGS="-Werror -Wzero-as-null-pointer-constant" FFLAGS=-Werror
151    - printf "====== Test A. Install into staging directory then into prefix directory (mimics distro package recipe) =====\n"
152    - make install DESTDIR="${PWD}/${T_DESTDIR}"
153    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -eq 0
154    - test "$(find ${PWD}/${T_DESTDIR} -mindepth 1 | wc -l)" -gt 0
155    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
156    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
157    - rm -r "${PWD}/${T_PREFIX}" "${PWD}/${T_DESTDIR}" && mkdir "${PWD}/${T_PREFIX}"
158    - printf "====== Test B. Install directly into prefix directory =====\n"
159    - make install
160    - test "$(find ${PWD}/${T_PREFIX} -mindepth 1 | wc -l)" -gt 0
161    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
162    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
163    - printf "====== Test C. Install manually with setuptools =====\n"
164    - export PETSC_DIR="${PWD}/${T_PREFIX}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py build)
165    - export PETSC_DIR="${PWD}/${T_PREFIX}" P="${PWD}" && (cd "${T_PETSC4PY}" && ${PYTHON} setup.py install --install-lib="${P}/${T_PREFIX}/lib")
166    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
167    - rm -r "${PWD}/${T_PREFIX}"/*/petsc4py*
168    - printf "====== Test D. Install manually with setuptools with staging =====\n"
169    - 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")
170    - (cd "${PWD}/${T_DESTDIR}" && find * -exec install -v -D "{}" "/{}" \; )
171    - mv arch-* hide/ && PETSC_DIR="${PWD}/${T_PREFIX}" ${T_VALIDATE_CMD} && mv hide/arch-* ./
172
173petsc4py-pip:
174  extends: .stage-2
175  tags:
176    - gce-stage2
177  variables:
178    PETSC_CONFIGURE_OPTIONS: --with-mpi=0 --with-fc=0
179    CFLAGS: -O0
180  script:
181    - python3 -m venv pip-builds
182    - source pip-builds/bin/activate
183    - python3 -m pip install --upgrade pip
184    - python3 -m pip install .
185    - python3 -m pip install src/binding/petsc4py
186    - python3 -m petsc4py
187
188checksource:
189  extends: .test-basic
190  stage: .pre
191  tags:
192    - gce-stage1
193  script:
194    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
195    - vermin --version
196    - make vermin
197    - make checkbadSource SHELL=bash
198    - make -f gmakefile check_output SHELL=bash
199    - make check_petsc4py_rst
200
201pause-for-approval:
202  extends: .test
203  stage: .pre
204  tags:
205    - gce-stage1
206  only:
207    refs:
208      - merge_requests
209    variables:
210      - $CI_MERGE_REQUEST_EVENT_TYPE == "merged_result"
211      - $CI_MERGE_REQUEST_EVENT_TYPE == "detached"
212  script:
213    - echo "pause-for-approval has no script to run"
214  variables:
215    GIT_STRATEGY: none
216  when: manual
217  allow_failure: false
218
219#
220# This provides the basic order of operations and options template for stage-2,3 tests.
221# Not all stage-2,3 need to follow this template, but most will.
222#
223.stage-23:
224  extends: .test
225  script:
226    - if [ -d ${HOME}/petsc-hash-pkgs/ ]; then find ${HOME}/petsc-hash-pkgs/ -maxdepth 1 -mindepth 1 -type d -mtime +25 -exec rm -rf {} \; ; fi
227    - printf "PATH:$PATH\n"
228    - printf "PYTHONPATH:$PYTHONPATH\n"
229    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
230    - 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
231    - printf "./config/examples/${TEST_ARCH}.py\n"
232    - cat ./config/examples/${TEST_ARCH}.py
233    - ./config/examples/${TEST_ARCH}.py
234    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}"
235    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check
236    - make updatedatafiles
237    - 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
238    - if [ -z ${DISABLE_TESTS+x} ]; then make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" cleantest allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS}; fi
239    - if [ ! -z ${RUN_GCOV+x} ]; then make gcov; fi
240  artifacts:
241    reports:
242      junit: ${TEST_ARCH}/tests/testresults.xml
243    name: "$CI_JOB_NAME"
244    when: always
245    paths:
246    - ${TEST_ARCH}/lib/petsc/conf/*.log
247    - ${TEST_ARCH}/lib/pkgconfig/petsc.pc
248    - ${TEST_ARCH}/tests/testresults.xml
249    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_tap.log
250    - ${TEST_ARCH}/tests/test_${TEST_ARCH}_err.log
251    - ${TEST_ARCH}/gcov.tar.gz
252    expire_in: 4 days
253  variables:
254    OPENBLAS_NUM_THREADS: 1
255
256.stage-2:
257  extends: .stage-23
258  stage: stage-2
259
260.stage-3:
261  extends: .stage-23
262  stage: stage-3
263
264#
265# The following provide templates for various OSes for pre/post info
266#
267
268.linux_test_noflags:
269  before_script:
270    - date
271    - hostname
272    - grep PRETTY_NAME /etc/os-release
273    - nproc
274    - lscpu
275    - ccache --zero-stats
276    - if [ ! -z ${LOAD_MODULES+x} ]; then module --trace load ${LOAD_MODULES}; module list; fi
277    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
278  after_script:
279    - date
280    - ccache --show-stats
281
282.linux_test_nofflags:
283  extends: .linux_test_noflags
284  variables:
285    MAKE_CFLAGS: -Werror
286    MAKE_CXXFLAGS: -Werror
287
288.linux_test:
289  extends: .linux_test_noflags
290  variables:
291    MAKE_CFLAGS: -Werror
292    MAKE_CXXFLAGS: -Werror
293    MAKE_FFLAGS: -Werror
294
295.freebsd_test:
296  variables:
297    MAKE_CFLAGS: -Werror
298    MAKE_CXXFLAGS: -Werror
299    MAKE_FFLAGS: -Werror
300  before_script:
301    - date
302    - hostname
303    - freebsd-version
304    - echo $(sysctl -n hw.ncpu)
305    - ccache --zero-stats
306  after_script:
307    - date
308    - ccache --show-stats
309
310.osx_test:
311  variables:
312    MAKE_CFLAGS: -Werror
313    MAKE_CXXFLAGS: -Werror
314    MAKE_FFLAGS: -Werror
315  before_script:
316    - date
317    - hostname
318    - sw_vers -productVersion
319    - echo $(sysctl -n hw.ncpu)
320    - ccache --zero-stats
321    - if [ ! -z ${INIT_SCRIPT+x} ]; then echo "sourcing ${INIT_SCRIPT}"; source ${INIT_SCRIPT}; fi
322  after_script:
323    - date
324    - ccache --show-stats
325
326.opensolaris_test:
327  before_script:
328    - date
329    - hostname
330    - uname -a
331    - nproc
332    - isainfo -x
333  after_script:
334    - date
335
336.mswin_test:
337  before_script:
338    - date
339    - hostname
340    - uname -a
341    - nproc
342  after_script:
343    - date
344
345#
346# The following tests run as part of stage-2.
347#
348# The tags variable used in the tests below connects the particular test with the runners
349# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
350# For example the test linux-sycl-double any runner that has the tags 'gce-nfs, linux-fast'
351# (in a blue box beneath it)
352#
353
354osx-m1:
355  extends:
356    - .stage-3
357    - .osx_test
358  tags:
359    - os:macos-m1
360  variables:
361    TEST_ARCH: arch-ci-osx-m1
362    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
363    INIT_SCRIPT: /Volumes/Scratch/svcpetsc/soft/py3venv/cython3setup.sh
364
365freebsd-cxx-cmplx-64idx-dbg:
366  extends:
367    - .stage-2
368    - .freebsd_test
369  tags:
370    - os:fbsd
371  variables:
372    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
373
374freebsd-c-single-opt:
375  extends:
376    - .stage-2
377    - .freebsd_test
378  tags:
379    - os:fbsd
380  variables:
381    TEST_ARCH: arch-ci-freebsd-c-single-opt
382
383linux-cuda-double:
384  extends:
385    - .stage-3
386    - .linux_test
387  tags:
388    - gpu:nvidia, os:linux, name:p1
389  variables:
390    TEST_ARCH: arch-ci-linux-cuda-double
391
392linux-gcc-quad-64idx-dbg:
393  extends:
394    - .stage-2
395    - .linux_test
396  tags:
397    - gce-stage2
398  variables:
399    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
400
401linux-gcc-pkgs-opt:
402  extends:
403    - .stage-2
404    - .linux_test
405  tags:
406    - gce-stage2
407  variables:
408    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
409
410linux-gcc-complex-opt-32bit:
411  extends:
412    - .stage-2
413    - .linux_test
414  tags:
415    - gce-stage2
416  variables:
417    TEST_ARCH: arch-ci-linux-gcc-complex-opt-32bit
418
419#do not run checkstack on MSWIN-UNI
420mswin-uni:
421  extends:
422    - .stage-3
423    - .mswin_test
424  tags:
425    - win-stage2
426  variables:
427    PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
428    TEST_ARCH: arch-ci-mswin-uni
429
430mswin-gnu:
431  extends:
432    - .stage-3
433    - .mswin_test
434  tags:
435    - win-stage2
436  variables:
437    TEST_ARCH: arch-ci-mswin-gnu
438    MAKE_CFLAGS: -Werror
439    MAKE_CXXFLAGS: -Werror
440    MAKE_FFLAGS: -Werror
441    DISABLE_TESTS: 1
442  artifacts:
443    reports:
444    paths:
445    - arch-*/lib/petsc/conf/*.log
446    expire_in: 4 days
447
448#
449# The following tests run as part of stage-3.
450#
451
452freebsd-cxx-cmplx-pkgs-dbg:
453  extends:
454    - .stage-3
455    - .freebsd_test
456  tags:
457    - os:fbsd
458  variables:
459    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
460
461freebsd-cxx-pkgs-opt:
462  extends:
463    - .stage-3
464    - .freebsd_test
465  tags:
466    - os:fbsd
467  variables:
468    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
469    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
470
471freebsd-pkgs-opt:
472  extends:
473    - .stage-3
474    - .freebsd_test
475  tags:
476    - os:fbsd
477  variables:
478    TEST_ARCH: arch-ci-freebsd-pkgs-opt
479
480linux-hip-double:
481  extends:
482    - .stage-3
483    - .linux_test_noflags
484  tags:
485    - gpu:amd, os:linux
486  variables:
487    TEST_ARCH: arch-ci-linux-hip-double
488
489linux-sycl-double:
490  extends:
491    - .stage-3
492    - .linux_test_noflags
493  tags:
494    - gce-nfs, linux-fast
495  variables:
496    TEST_ARCH: arch-ci-linux-sycl-double
497    LOAD_MODULES: compiler/latest mpi/latest cmake/3.20.5-yjp2hz6
498    TEST_OPTS: query=requires queryval=kokkos_kernels
499
500linux-c-exodus-dbg:
501  extends:
502    - .stage-3
503    - .linux_test
504  tags:
505    - gpu:nvidia, os:linux, name:frog
506  variables:
507    TEST_ARCH: arch-ci-linux-c-exodus-dbg
508    RUN_GCOV: 1
509    TEST_OPTS: -j1 query=requires queryval=cuda
510
511linux-cuda11-double:
512  extends:
513    - .stage-3
514    - .linux_test
515  tags:
516    - gpu:nvidia, os:linux, name:frog
517  variables:
518    TEST_ARCH: arch-ci-linux-cuda11-double
519    TEST_OPTS: -j1 query=requires queryval=cuda
520
521linux-cuda11-complex:
522  extends:
523    - .stage-3
524    - .linux_test
525  tags:
526    - gpu:nvidia, os:linux, name:frog
527  variables:
528    TEST_ARCH: arch-ci-linux-cuda11-complex
529    TEST_OPTS: -j1 query=requires queryval=cuda
530
531linux-cuda-double-64idx:
532  extends:
533    - .stage-3
534    - .linux_test
535  tags:
536    - gpu:nvidia, os:linux, name:p1
537  variables:
538    TEST_ARCH: arch-ci-linux-cuda-double-64idx
539    TEST_OPTS: -j1 query=requires queryval=cuda
540
541linux-cuda-single-cxx:
542  extends:
543    - .stage-3
544    - .linux_test
545  tags:
546    - gpu:nvidia, os:linux
547  variables:
548    TEST_ARCH: arch-ci-linux-cuda-single-cxx
549    TEST_OPTS: -j1 query=requires queryval=cuda
550
551linux-cuda-uni-pkgs:
552  extends:
553    - .stage-3
554    - .linux_test
555  tags:
556    - gpu:nvidia, os:linux
557  variables:
558    TEST_ARCH: arch-ci-linux-cuda-uni-pkgs
559    TEST_OPTS: -j4 query=requires queryval=cuda
560
561linux-viennacl:
562  extends:
563    - .stage-3
564    - .linux_test
565  tags:
566    - gpu:nvidia, os:linux
567  variables:
568    TEST_ARCH: arch-ci-linux-viennacl
569    MAKE_CXXFLAGS: -Werror -Wno-ignored-attributes
570    TEST_OPTS: -j1 query=requires queryval=viennacl
571
572linux-without-fc:
573  extends:
574    - .stage-3
575    - .linux_test
576  tags:
577    - gce-nfs
578  variables:
579    TEST_ARCH: arch-ci-linux-without-fc
580
581linux-cmplx-single:
582  extends:
583    - .stage-3
584    - .linux_test
585  tags:
586    - name:si
587  variables:
588    FLEXIBLAS: netlib
589    TEST_ARCH: arch-ci-linux-cmplx-single
590
591linux-gcc-cxx-avx2:
592  extends:
593    - .stage-3
594    - .linux_test
595  tags:
596    - name:isdp001
597  variables:
598    TEST_ARCH: arch-ci-linux-gcc-cxx-avx2
599
600linux-clang-avx:
601  extends:
602    - .stage-3
603    - .linux_test
604  tags:
605    - name:isdp001
606  variables:
607    TEST_ARCH: arch-ci-linux-clang-avx
608
609linux-knl:
610  extends:
611    - .stage-3
612    - .linux_test
613  tags:
614    - name:isdp001
615  variables:
616    TEST_ARCH: arch-ci-linux-knl
617
618linux-intel-mkl-single:
619  extends:
620    - .stage-3
621    - .linux_test_nofflags
622  tags:
623    - name:isdp001
624  variables:
625    TEST_ARCH: arch-ci-linux-intel-mkl-single
626
627linux-cxx-cmplx-pkgs-64idx:
628  extends:
629    - .stage-3
630    - .linux_test
631  tags:
632    - gce-nfs
633  variables:
634    TEST_ARCH: arch-ci-linux-cxx-cmplx-pkgs-64idx
635    LOAD_MODULES: llvm/9.0.0-7fyffox gcc/8.3.0-fjpc5ys cmake/3.14.2-rl3q676
636
637# Set env vars for 'Kokkos + OpenMP' tests, so that they won't give warnings
638linux-pkgs-dbg-ftn-interfaces:
639  extends:
640    - .stage-3
641    - .linux_test
642  tags:
643    - gce-nfs
644  variables:
645    TEST_ARCH: arch-ci-linux-pkgs-dbg-ftn-interfaces
646    LOAD_MODULES: cmake/3.20.5-yjp2hz6
647    OMP_PROC_BIND: "false"
648    OMP_NUM_THREADS: 4
649
650linux-pkgs-cxx-mlib:
651  extends:
652    - .stage-3
653    - .linux_test
654  tags:
655    - gce-nfs
656  variables:
657    TEST_ARCH: arch-ci-linux-pkgs-cxx-mlib
658    LOAD_MODULES: gcc/11.1.0-5ikoznk cmake/3.20.5-yjp2hz6
659
660linux-pkgs-valgrind:
661  extends:
662    - .stage-3
663    - .linux_test
664  tags:
665    - gce-nfs, linux-fast
666  variables:
667    TEST_ARCH: arch-ci-linux-pkgs-valgrind
668    TIMEOUT: 7200
669    LOAD_MODULES: valgrind/3.17.0
670
671linux-pkgs-opt:
672  extends:
673    - .stage-3
674    - .linux_test
675  tags:
676    - gce-nfs, linux-fast
677  variables:
678    TEST_ARCH: arch-ci-linux-pkgs-opt
679    LOAD_MODULES: gcc/10.1.0-5hiqhdh
680
681linux-pkgs-gcov:
682  extends:
683    - .stage-3
684    - .linux_test
685  tags:
686    - gce-nfs, linux-gcov
687  variables:
688    TEST_ARCH: arch-ci-linux-pkgs-gcov
689    RUN_GCOV: 1
690
691linux-cmplx-gcov:
692  extends:
693    - .stage-3
694    - .linux_test
695  tags:
696    - gce-nfs, linux-gcov
697  variables:
698    PETSC_OPTIONS:  -vecscatter_mpi1 false -options_left false -checkstack
699    TEST_ARCH: arch-ci-linux-cmplx-gcov
700    LOAD_MODULES: gcc/8.3.0-fjpc5ys
701    RUN_GCOV: 1
702
703linux-matlab-ilp64-gcov:
704  extends:
705    - .stage-3
706    - .linux_test
707  tags:
708    - gce-nfs, linux-gcov
709  variables:
710    TEST_ARCH: arch-ci-linux-matlab-ilp64-gcov
711    LOAD_MODULES: matlab/R2018a
712    RUN_GCOV: 1
713  allow_failure: true
714
715linux-gcov:
716  extends:
717    - .stage-3
718    - .linux_test
719  tags:
720    - gce-nfs, linux-gcov
721  variables:
722    TEST_ARCH: arch-ci-linux-gcov
723    RUN_GCOV: 1
724
725linux-pgi:
726  extends:
727    - .stage-3
728    - .linux_test_noflags
729  tags:
730    - gce-nfs, linux-mcpu
731  variables:
732    TEST_ARCH: arch-ci-linux-pgi
733    LOAD_MODULES: hpc_sdk/20.9
734
735# If the Nag license server fails then ${PETSC_DIR}/naglicenseproblem is created and the job is marked as failed but allow_failure
736linux-nagfor:
737  extends:
738    - .stage-3
739    - .linux_test_nofflags
740  tags:
741    - gce-nfs, linux-mcpu
742  script:
743    - rm -f naglicenseproblem
744    - printf "PATH:$PATH\n"
745    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
746    - 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
747    - printf "./config/examples/${TEST_ARCH}.py\n"
748    - cat ./config/examples/${TEST_ARCH}.py
749    - ./config/examples/${TEST_ARCH}.py || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
750    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
751    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" check || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
752    - make updatedatafiles
753    - make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" FFLAGS="${MAKE_FFLAGS}" cleantest allgtests-tap TIMEOUT=${TIMEOUT}  ${TEST_OPTS} || if [ -f naglicenseproblem ]; then exit 126; else exit 1; fi
754  variables:
755    LOAD_MODULES: nag/6.1
756    TEST_ARCH: arch-ci-linux-nagfor
757  allow_failure:
758    exit_codes: 126
759
760linux-intel-cmplx:
761  extends:
762    - .stage-3
763    - .linux_test_nofflags
764  tags:
765    - gce-nfs
766  variables:
767    TEST_ARCH: arch-ci-linux-intel-cmplx
768    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib cmake/3.20.5-yjp2hz6
769    ENABLE_PETSC4PY_LDPRELOAD: 1
770
771linux-xsdk-dbg:
772  extends:
773    - .stage-3
774    - .linux_test
775  tags:
776    - gce-nfs
777  variables:
778    TEST_ARCH: arch-ci-linux-xsdk-dbg
779    LOAD_MODULES: gcc/8.3.0-fjpc5ys
780
781linux-analyzer:
782  extends:
783    - .stage-2
784    - .linux_test
785  tags:
786    - gce-stage2
787  script:
788    - printf "PATH:$PATH\n"
789    - printf "PYTHONPATH:$PYTHONPATH\n"
790    - printf "PETSC_OPTIONS:$PETSC_OPTIONS\n"
791    - 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
792    - printf "./config/examples/${TEST_ARCH}.py\n"
793    - cat ./config/examples/${TEST_ARCH}.py
794    - ./config/examples/${TEST_ARCH}.py
795    - make LINTER_OPTIONS="${LINTER_OPTIONS}" test-lint
796    - make LINTER_OPTIONS="${LINTER_OPTIONS}" lint
797  variables:
798    TEST_ARCH: arch-ci-linux-analyzer
799    LOAD_MODULES: llvm/12.0.0-hgg7qmu cmake/3.20.5-zyz2eld
800    LINTER_OPTIONS: "--PETSC_ARCH=${TEST_ARCH} --clang_lib=`llvm-config --libdir`/libclang.so.12 --verbose --werror"
801  artifacts:
802    paths:
803    - ${TEST_ARCH}/lib/petsc/conf/*.log
804    - ./petscLintPatches/*.patch
805
806linux-intel:
807  extends:
808    - .stage-3
809    - .linux_test_nofflags
810  tags:
811    - gce-nfs
812  variables:
813    TEST_ARCH: arch-ci-linux-intel
814    LOAD_MODULES: intel-mkl/19.5 intel/19.0-nompilib
815
816linux-opt-misc:
817  extends:
818    - .stage-3
819    - .linux_test
820  tags:
821    - gce-nfs, linux-fast
822  variables:
823    TEST_ARCH: arch-ci-linux-opt-misc
824    LOAD_MODULES: gcc/6.5.0-57usejd
825
826linux-pkgs-64idx:
827  extends:
828    - .stage-3
829    - .linux_test
830  tags:
831    - gce-nfs, linux-mcpu
832  variables:
833    TEST_ARCH: arch-ci-linux-pkgs-64idx
834    LOAD_MODULES: cmake/3.20.5-yjp2hz6 intel-mkl/19.5
835
836linux-64idx-i8:
837  extends:
838    - .stage-3
839    - .linux_test
840  tags:
841    - gce-nfs
842  variables:
843    TEST_ARCH: arch-ci-linux-64idx-i8
844
845linux-gcc-ifc-cmplx:
846  extends:
847    - .stage-3
848    - .linux_test_nofflags
849  tags:
850    - gce-nfs
851  variables:
852    TEST_ARCH: arch-ci-linux-gcc-ifc-cmplx
853    LOAD_MODULES: intel/19.0-nompilib cmake/3.20.0-vov726r
854
855linux-opt-cxx-quad:
856  extends:
857    - .stage-3
858    - .linux_test
859  tags:
860    - gce-nfs
861  variables:
862    TEST_ARCH: arch-ci-linux-opt-cxx-quad
863
864linux-ILP64:
865  extends:
866    - .stage-3
867    - .linux_test
868  tags:
869    - gce-nfs
870  variables:
871    TEST_ARCH: arch-ci-linux-ILP64
872    LOAD_MODULES: mpich/2-1.5-gcc750
873
874linux-64idx-i8-uni:
875  extends:
876    - .stage-3
877    - .linux_test
878  tags:
879    - gce-nfs
880  variables:
881    TEST_ARCH: arch-ci-linux-64idx-i8-uni
882
883mswin-intel-cxx-cmplx:
884  extends:
885    - .stage-3
886    - .mswin_test
887  tags:
888    - os:win
889  variables:
890    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
891
892#mswin-intel:
893#  extends:
894#    - .stage-3
895#    - .mswin_test
896#  tags:
897#    - os:win
898#  variables:
899#    TEST_ARCH: arch-ci-mswin-intel
900
901#mswin-opt-impi:
902#  extends:
903#    - .stage-3
904#    - .mswin_test
905#  tags:
906#    - os:win
907#  variables:
908#    TEST_ARCH: arch-ci-mswin-opt-impi
909#    DISABLE_TESTS: 1
910
911opensolaris-pkgs-opt:
912  extends:
913    - .stage-3
914    - .opensolaris_test
915  tags:
916    - name:n-gage
917  variables:
918    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
919
920opensolaris-cmplx-pkgs-dbg:
921  extends:
922    - .stage-3
923    - .opensolaris_test
924  tags:
925    - name:n-gage
926  variables:
927    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
928
929opensolaris-misc:
930  extends:
931    - .stage-3
932    - .opensolaris_test
933  tags:
934    - name:n-gage
935  variables:
936    TEST_ARCH: arch-ci-opensolaris-misc
937
938osx-cxx-cmplx-pkgs-dbg:
939  extends:
940    - .stage-3
941    - .osx_test
942  tags:
943    - os:macos
944  variables:
945    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
946
947osx-cxx-pkgs-opt:
948  extends:
949    - .stage-3
950    - .osx_test
951  tags:
952    - os:macos, opt
953  variables:
954    PETSC_OPTIONS: -vecscatter_mpi1 false -options_left false -checkstack
955    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
956    MAKE_CXXFLAGS: -Werror -Wno-pass-failed
957
958osx-dbg:
959  extends:
960    - .stage-3
961    - .osx_test
962  tags:
963    - os:macos
964  variables:
965    TEST_ARCH: arch-ci-osx-dbg
966
967osx-xsdk-opt:
968  extends:
969    - .stage-3
970    - .osx_test
971  tags:
972    - os:macos, opt
973  variables:
974    TEST_ARCH: arch-ci-osx-xsdk-opt
975
976# job for analyzing the final coverage results
977analyze-pipeline:
978  extends: .test
979  stage: .post
980  tags:
981    - gce-nfs-short
982  dependencies:
983    - linux-c-exodus-dbg
984    - linux-pkgs-gcov
985    - linux-cmplx-gcov
986    - linux-matlab-ilp64-gcov
987    - linux-gcov
988  variables:
989    PETSC_ARCH: arch-ci-analyze-pipeline
990  before_script:
991    - date
992    - hostname
993  script:
994  - ./configure --with-mpi=0 --with-cxx=0 --with-c2html
995  - make srchtml
996  - make mergegcov
997  artifacts:
998    name: "$CI_JOB_NAME"
999    when: always
1000    paths:
1001    - arch-ci-analyze-pipeline/*
1002    expire_in: 4 days
1003
1004
1005#
1006# Base job for a documentation build
1007#
1008.docs:
1009  stage: stage-2
1010  tags:
1011    - gce-stage2
1012  before_script:
1013    - VENV=venv-petsc-docs &&
1014      python3 -m venv $VENV &&
1015      . $VENV/bin/activate &&
1016      cd doc &&
1017      pip install -r requirements.txt
1018
1019#
1020# Build documentation and make available for review using GitLab pages
1021#
1022docs-review:
1023  extends:
1024    - .docs
1025    - .test-basic
1026  script:
1027    - (make html BUILDDIR="../public" SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1028    - (make latexpdf SPHINXOPTS="-T -E -W --keep-going") || (printf "Sphinx build failed (warnings count as errors)\n" && false)
1029    - cp _build/latex/manual.pdf ../public/html/docs/manual/
1030  environment:
1031    name: review/$CI_COMMIT_REF_NAME
1032    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/html/index.html
1033  artifacts:
1034    paths:
1035      - public
1036  except:
1037    variables:
1038      - $PETSC_CI_SCHEDULED =~ /yes/
1039
1040#
1041# Deploy documentation using GitLab pages
1042#
1043pages:  # this job name has special meaning to GitLab
1044  extends: .docs
1045  interruptible: true
1046  script:
1047    - mkdir -p ../public/ && cp public/* ../public/
1048    - git fetch --unshallow --no-tags origin +release:remotes/origin/release +main:remotes/origin/main
1049    - git checkout origin/main && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/main" && make latexpdf && mkdir -p ../public/main/docs/manual && cp _build/latex/manual.pdf ../public/main/docs/manual/
1050    - make clean BUILDDIR="../public/release"
1051    - git checkout origin/release && pip install -r requirements.txt && make website-deploy BUILDDIR="../public/release" && make latexpdf && mkdir -p ../public/release/docs/manual && cp _build/latex/manual.pdf ../public/release/docs/manual/
1052  only:
1053    variables:
1054      - $PETSC_CI_SCHEDULED == "yes"
1055  artifacts:
1056    paths:
1057      - public
1058
1059#
1060#
1061# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
1062# that fail produce a warning, but do not block execution of a pipeline.
1063#
1064
1065.test-experimental:
1066  extends: .test
1067  allow_failure: true
1068
1069