xref: /petsc/.gitlab-ci.yml (revision 42cde88baac8c020a4e2dd96861821f9a7ab07b5)
128d80369SJed Brown
228d80369SJed 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.
328d80369SJed Brown#
428d80369SJed 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.
528d80369SJed Brown#
628d80369SJed Brown# The test-long tests are only started if all of the test-short tests run without error and if the merge request has
728d80369SJed Brown# been labeled with "fulltest".
828d80369SJed Brown#
928d80369SJed Brown
10340aff75SJed Brownstages:
1128d80369SJed 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
1828d80369SJed Brown#
1928d80369SJed Brown# The most basic template that most tests will expand upon. It ensures that the tests are run only for merge requests.
2028d80369SJed Brown#
2128d80369SJed Brown
22e74c1a09SJed Brown.test:
23410f5c6aSJed Brown  only:
240962a0d6SJed Brown    refs:
25410f5c6aSJed Brown      - merge_requests
26*42cde88bSBarry Smith      - web
2728d80369SJed Brown
2828d80369SJed Brown#
2928d80369SJed Brown#  This provides the basic order of operations and options template for cloud based test-short tests.
3028d80369SJed Brown#  Not all test-short need to follow this template but most will.
3128d80369SJed Brown#
3228d80369SJed Brown
3328d80369SJed Brown.test-short:
3428d80369SJed Brown  extends: .test
3528d80369SJed Brown  stage: test-short
3628d80369SJed Brown  image: jedbrown/mpich-ccache
37340aff75SJed Brown  before_script:
38340aff75SJed Brown    - echo nproc=$(nproc)
39340aff75SJed Brown    - cat /proc/cpuinfo
40525f0e14SJed Brown    - export CCACHE_COMPILERCHECK=content
4104bc68e0SJed Brown    - export CCACHE_DIR=$(pwd)/.ccache
4204bc68e0SJed Brown    - ccache --show-stats
4304bc68e0SJed Brown    - ccache --zero-stats
44340aff75SJed Brown  script:
451c6b2e5dSSatish Balay    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
4602e5f532SJed Brown    - make CFLAGS=-Werror
4728d80369SJed Brown    - make allgtests-tap search="${TEST_SEARCH}" TIMEOUT=300
483d889285SJed Brown  after_script:
4904bc68e0SJed Brown    - CCACHE_DIR=$(pwd)/.ccache ccache --show-stats
50e22b0966SJed Brown  artifacts:
51e22b0966SJed Brown    reports:
52e22b0966SJed Brown      junit: arch-*/tests/testresults.xml
533d889285SJed Brown  cache:
543d889285SJed Brown    paths:
5504bc68e0SJed Brown      - .ccache/
563d889285SJed Brown    key: "${CI_JOB_NAME}"
57e74c1a09SJed Brown
5828d80369SJed Brown#
5928d80369SJed Brown# The following tests run on the cloud as part of test-short.
6028d80369SJed Brown#
6128d80369SJed Brown
621c6b2e5dSSatish Balaympich-cxx-py3:
6328d80369SJed 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:
7028d80369SJed 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:
7928d80369SJed 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
8828d80369SJed Brown#
8928d80369SJed Brown# This provides the basic order of operations and options template for test-long tests.
9028d80369SJed Brown# Not all test-long need to follow this template, but most will.
9128d80369SJed Brown#
9228d80369SJed Brown.test-long:
9328d80369SJed 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
10728d80369SJed Brown#
10828d80369SJed Brown# The following tests run on MCS systems as part of test-long.
10928d80369SJed Brown#
11028d80369SJed Brown# The tags variable used in the tests below connects the particular test with the runners
11128d80369SJed Brown# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
11228d80369SJed Brown# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
11328d80369SJed Brown# any runner that has the tag (in a blue box beneath it) of mcs-linux.
11428d80369SJed Brown#
11528d80369SJed Brown
11628d80369SJed Brown.mcs_test:
11728d80369SJed Brown  extends: .test-long
11828d80369SJed 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:
14828d80369SJed Brown#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
14928d80369SJed Brown#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
15028d80369SJed Brown    PETSC_OPTIONS: <
15128d80369SJed Brown      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
15228d80369SJed 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
20528d80369SJed Brown#
20628d80369SJed Brown# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
20728d80369SJed Brown# that fail produce a warning, but do not block execution of a pipeline.
20828d80369SJed Brown#
20928d80369SJed Brown
21028d80369SJed Brown.test-experimental:
21128d80369SJed Brown  extends: .test
21228d80369SJed Brown  allow_failure: true
21328d80369SJed Brown
2144f89072dSBarry Smithbarry-checksource:
21528d80369SJed Brown  extends: .test-experimental
21628d80369SJed Brown  stage: test-short
21728d80369SJed Brown  variables:
21828d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
21928d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
2204f89072dSBarry Smith  tags:
2214f89072dSBarry Smith    - barry
2224f89072dSBarry Smith  script:
22328d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0
22428d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` make checkbadSource
22528d80369SJed Brown
22628d80369SJed Brownbarry-arch-hash:
22728d80369SJed Brown  extends: .test-experimental
22828d80369SJed Brown  stage: test-short
22928d80369SJed Brown  variables:
23028d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
23128d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
23228d80369SJed Brown  tags:
23328d80369SJed Brown    - barry
23428d80369SJed Brown  script:
23528d80369SJed Brown    - PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0 --arch-hash
23628d80369SJed Brown    - PETSC_DIR=`pwd` make checkbadSource
237