xref: /petsc/.gitlab-ci.yml (revision 28d803690300a3a9b429bcf102810e3f73c1937e)
1*28d80369SJed Brown
2*28d80369SJed Brown# test-short take only a few minutes and generally run on the cloud; they do not run the full test suite or external packages.
3*28d80369SJed Brown#
4*28d80369SJed Brown# test-long often runs on MCS systems and may take an hour or more. They run the full test suite and may test external packages.
5*28d80369SJed Brown#
6*28d80369SJed Brown# The test-long tests are only started if all of the test-short tests run without error and if the merge request has
7*28d80369SJed Brown# been labeled with "fulltest".
8*28d80369SJed Brown#
9*28d80369SJed Brown
10340aff75SJed Brownstages:
11*28d80369SJed Brown  - test-short
12636284c1SSatish Balay  - test-long
13340aff75SJed Brownvariables:
14340aff75SJed Brown  GIT_STRATEGY: fetch
15c592e2e1SSatish Balay  GIT_CLEAN_FLAGS: -ffdxq
16a3e7580aSSatish Balay  PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
17340aff75SJed Brown
18*28d80369SJed Brown#
19*28d80369SJed Brown# The most basic template that most tests will expand upon. It ensures that the tests are run only for merge requests.
20*28d80369SJed Brown#
21*28d80369SJed Brown
22e74c1a09SJed Brown.test:
23410f5c6aSJed Brown  only:
240962a0d6SJed Brown    refs:
25410f5c6aSJed Brown      - merge_requests
26*28d80369SJed Brown
27*28d80369SJed Brown#
28*28d80369SJed Brown#  This provides the basic order of operations and options template for cloud based test-short tests.
29*28d80369SJed Brown#  Not all test-short need to follow this template but most will.
30*28d80369SJed Brown#
31*28d80369SJed Brown
32*28d80369SJed Brown.test-short:
33*28d80369SJed Brown  extends: .test
34*28d80369SJed Brown  stage: test-short
35*28d80369SJed Brown  image: jedbrown/mpich-ccache
36340aff75SJed Brown  before_script:
37340aff75SJed Brown    - echo nproc=$(nproc)
38340aff75SJed Brown    - cat /proc/cpuinfo
393d889285SJed Brown    - ccache --zero-stats
409ef1a7e2SJed Brown    - echo "${CI_JOB_NAME}"
41525f0e14SJed Brown    - export CCACHE_COMPILERCHECK=content
42340aff75SJed Brown  script:
431c6b2e5dSSatish Balay    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
44377e4ec7SSatish Balay    - make -j$(nproc) -l$(nproc) CFLAGS=-Werror
45*28d80369SJed Brown    - make allgtests-tap search="${TEST_SEARCH}" TIMEOUT=300
463d889285SJed Brown  after_script:
47*28d80369SJed Brown    - ls -l /ccache/
48*28d80369SJed Brown    - du -hs /ccache
493d889285SJed Brown    - ccache --show-stats
50e22b0966SJed Brown  artifacts:
51e22b0966SJed Brown    reports:
52e22b0966SJed Brown      junit: arch-*/tests/testresults.xml
533d889285SJed Brown  cache:
543d889285SJed Brown    paths:
559ef1a7e2SJed Brown      - /ccache/
563d889285SJed Brown    key: "${CI_JOB_NAME}"
57e74c1a09SJed Brown
58*28d80369SJed Brown#
59*28d80369SJed Brown# The following tests run on the cloud as part of test-short.
60*28d80369SJed Brown#
61*28d80369SJed Brown
621c6b2e5dSSatish Balaympich-cxx-py3:
63*28d80369SJed Brown  extends: .test-short
64e74c1a09SJed Brown  variables:
651c6b2e5dSSatish Balay    PYTHON: python3
661c6b2e5dSSatish Balay    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-clanguage=cxx --with-fc=0
67e74c1a09SJed Brown    TEST_SEARCH: snes_tutorials-ex48%
68340aff75SJed Brown
69340aff75SJed Brownuni-complex-float-int64:
70*28d80369SJed Brown  extends: .test-short
71e74c1a09SJed Brown  variables:
721c6b2e5dSSatish Balay    PYTHON: python3
73e74c1a09SJed Brown    CONFIG_OPTS: <
74e74c1a09SJed Brown      --with-mpi=0
75340aff75SJed Brown      --with-scalar-type=complex --with-precision=single --with-64-bit-indices
76e74c1a09SJed Brown    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
77340aff75SJed Brown
781c6b2e5dSSatish Balayc89-mlib-static-py2:
79*28d80369SJed Brown  extends: .test-short
803d889285SJed Brown  image: jedbrown/mpich-ccache:python2
811c6b2e5dSSatish Balay  variables:
82377e4ec7SSatish Balay    PYTHON: python2
831c6b2e5dSSatish Balay    CONFIG_OPTS: <
841c6b2e5dSSatish Balay      --with-mpi-dir=/usr/local
851c6b2e5dSSatish Balay      --with-single-library=0 --with-shared-libraries=0 'CFLAGS=-std=c89 -pedantic -Wno-long-long -Wno-overlength-strings'
861c6b2e5dSSatish Balay    TEST_SEARCH: snes_tutorials-ex48%
871c6b2e5dSSatish Balay
88*28d80369SJed Brown#
89*28d80369SJed Brown# This provides the basic order of operations and options template for test-long tests.
90*28d80369SJed Brown# Not all test-long need to follow this template, but most will.
91*28d80369SJed Brown#
92*28d80369SJed Brown.test-long:
93*28d80369SJed Brown  extends: .test
94636284c1SSatish Balay  stage: test-long
95410f5c6aSJed Brown  only:
960962a0d6SJed Brown    variables:
970962a0d6SJed Brown      - $CI_MERGE_REQUEST_LABELS =~ /fulltest/
9844cd3865SJed Brown  script:
991702e285SSatish Balay    - ./config/examples/${TEST_ARCH}.py
10044cd3865SJed Brown    - make
10144cd3865SJed Brown    - make check
1021702e285SSatish Balay    - make cleantest allgtests-tap TIMEOUT=300
1038166029eSJed Brown  artifacts:
1048166029eSJed Brown    reports:
1058166029eSJed Brown      junit: ${TEST_ARCH}/tests/testresults.xml
10644cd3865SJed Brown
107*28d80369SJed Brown#
108*28d80369SJed Brown# The following tests run on MCS systems as part of test-long.
109*28d80369SJed Brown#
110*28d80369SJed Brown# The tags variable used in the tests below connects the particular test with the runners
111*28d80369SJed Brown# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
112*28d80369SJed Brown# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
113*28d80369SJed Brown# any runner that has the tag (in a blue box beneath it) of mcs-linux.
114*28d80369SJed Brown#
115*28d80369SJed Brown
116*28d80369SJed Brown.mcs_test:
117*28d80369SJed Brown  extends: .test-long
118*28d80369SJed Brown
1191702e285SSatish Balay.linux_mcs_test:
1201702e285SSatish Balay  extends: .mcs_test
1211702e285SSatish Balay  tags:
1229f54a376SSatish Balay    - mcs-linux
1231702e285SSatish Balay  before_script:
1241702e285SSatish Balay    - hostname
1251702e285SSatish Balay    - grep PRETTY_NAME /etc/os-release
1261702e285SSatish Balay    - echo $(nproc)
127525f0e14SJed Brown    - ccache --zero-stats
128525f0e14SJed Brown  after_script:
129525f0e14SJed Brown    - ccache --show-stats
1301702e285SSatish Balay
1311702e285SSatish Balay.freebsd_mcs_test:
1321702e285SSatish Balay  extends: .mcs_test
1338623489dSJed Brown  tags:
1349f54a376SSatish Balay    - mcs-freebsd
1358623489dSJed Brown  before_script:
1368623489dSJed Brown    - hostname
1371702e285SSatish Balay    - freebsd-version
1381702e285SSatish Balay    - echo $(sysctl -n hw.ncpu)
139525f0e14SJed Brown    - ccache --zero-stats
140525f0e14SJed Brown  after_script:
141525f0e14SJed Brown    - ccache --show-stats
1421702e285SSatish Balay
14320099508SSatish Balay.osx_mcs_test:
14420099508SSatish Balay  extends: .mcs_test
14520099508SSatish Balay  tags:
1469f54a376SSatish Balay    - mcs-osx
147a3e7580aSSatish Balay  variables:
148*28d80369SJed Brown#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
149*28d80369SJed Brown#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
150*28d80369SJed Brown    PETSC_OPTIONS: <
151*28d80369SJed Brown      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
152*28d80369SJed Brown      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
15320099508SSatish Balay  before_script:
15420099508SSatish Balay    - hostname
15520099508SSatish Balay    - sw_vers -productVersion
15620099508SSatish Balay    - echo $(sysctl -n hw.ncpu)
157525f0e14SJed Brown    - ccache --zero-stats
158525f0e14SJed Brown  after_script:
159525f0e14SJed Brown    - ccache --show-stats
16020099508SSatish Balay
16120099508SSatish Balay.opensolaris_mcs_test:
16220099508SSatish Balay  extends: .mcs_test
16320099508SSatish Balay  tags:
1649f54a376SSatish Balay    - mcs-opensolaris
16520099508SSatish Balay  before_script:
16620099508SSatish Balay    - hostname
16720099508SSatish Balay    - uname -a
16820099508SSatish Balay    - echo $(nproc)
16920099508SSatish Balay
1701702e285SSatish Balaylinux-gcc-complex-opt:
1711702e285SSatish Balay  extends: .linux_mcs_test
1721702e285SSatish Balay  variables:
1734d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-complex-opt
1741702e285SSatish Balay
1751702e285SSatish Balaylinux-gcc-pkgs-opt:
1761702e285SSatish Balay  extends: .linux_mcs_test
1771702e285SSatish Balay  variables:
1784d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
1791702e285SSatish Balay
1801702e285SSatish Balaylinux-gcc-quad-64idx-dbg:
1811702e285SSatish Balay  extends: .linux_mcs_test
1821702e285SSatish Balay  variables:
1834d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
1841702e285SSatish Balay
1851702e285SSatish Balayfreebsd-c-single-opt:
1861702e285SSatish Balay  extends: .freebsd_mcs_test
1871702e285SSatish Balay  variables:
1884d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-c-single-opt
1891702e285SSatish Balay
1901702e285SSatish Balayfreebsd-cxx-cmplx-64idx-dbg:
1911702e285SSatish Balay  extends: .freebsd_mcs_test
1921702e285SSatish Balay  variables:
1934d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
1948623489dSJed Brown
19520099508SSatish Balayosx-cxx-pkgs-opt:
19620099508SSatish Balay  extends: .osx_mcs_test
19720099508SSatish Balay  variables:
1984d09bf9bSSatish Balay    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
19920099508SSatish Balay
20020099508SSatish Balayopensolaris-cmplx-pkgs-dbg:
20120099508SSatish Balay  extends: .opensolaris_mcs_test
20220099508SSatish Balay  variables:
2034d09bf9bSSatish Balay    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
2044f89072dSBarry Smith
205*28d80369SJed Brown#
206*28d80369SJed Brown# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
207*28d80369SJed Brown# that fail produce a warning, but do not block execution of a pipeline.
208*28d80369SJed Brown#
209*28d80369SJed Brown
210*28d80369SJed Brown.test-experimental:
211*28d80369SJed Brown  extends: .test
212*28d80369SJed Brown  allow_failure: true
213*28d80369SJed Brown
2144f89072dSBarry Smithbarry-checksource:
215*28d80369SJed Brown  extends: .test-experimental
216*28d80369SJed Brown  stage: test-short
217*28d80369SJed Brown  variables:
218*28d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
219*28d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
2204f89072dSBarry Smith  tags:
2214f89072dSBarry Smith    - barry
2224f89072dSBarry Smith  script:
223*28d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0
224*28d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` make checkbadSource
225*28d80369SJed Brown
226*28d80369SJed Brownbarry-arch-hash:
227*28d80369SJed Brown  extends: .test-experimental
228*28d80369SJed Brown  stage: test-short
229*28d80369SJed Brown  variables:
230*28d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
231*28d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
232*28d80369SJed Brown  tags:
233*28d80369SJed Brown    - barry
234*28d80369SJed Brown  script:
235*28d80369SJed Brown    - PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0 --arch-hash
236*28d80369SJed Brown    - PETSC_DIR=`pwd` make checkbadSource
237