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