xref: /petsc/.gitlab-ci.yml (revision 9c15ed49822b6cccfdfb6835502bd928629ee1bb)
128d80369SJed Brown#
2*9c15ed49SBarry Smith# stage-1 take only a few minutes and generally run on the cloud; they do not run the full test suite or external packages.
328d80369SJed Brown#
4*9c15ed49SBarry Smith# 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
504df5595SBarry Smith#
6*9c15ed49SBarry Smith# 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*9c15ed49SBarry Smith#         (not yet implemented)
804df5595SBarry Smith#
9*9c15ed49SBarry Smith# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
10*9c15ed49SBarry Smith#   You can limit the testing by using the variable STAGE with value 1 or 2
11*9c15ed49SBarry Smith#
12*9c15ed49SBarry Smith# By default the test branch is merged to master before testing. (not yet implemented)
13*9c15ed49SBarry Smith#   You can limite this by using the variable MERGETOMASTER with value 0 (not yet implemented)
1428d80369SJed Brown#
1528d80369SJed Brown
16340aff75SJed Brownstages:
17*9c15ed49SBarry Smith  - stage-1
18*9c15ed49SBarry Smith  - stage-2
19*9c15ed49SBarry Smith  - stage-3
20340aff75SJed Brownvariables:
21340aff75SJed Brown  GIT_STRATEGY: fetch
22c592e2e1SSatish Balay  GIT_CLEAN_FLAGS: -ffdxq
23a3e7580aSSatish Balay  PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
24340aff75SJed Brown
2528d80369SJed Brown#
26*9c15ed49SBarry Smith# The most basic template that most tests will expand upon. In particular merge requests and branch pushes DO NOT trigger testing
2728d80369SJed Brown#
2828d80369SJed Brown
29e74c1a09SJed Brown.test:
30410f5c6aSJed Brown  only:
310962a0d6SJed Brown    refs:
32*9c15ed49SBarry Smith#     Set with CI/CD Shedules - New Schedule
33*9c15ed49SBarry Smith      - schedules
34*9c15ed49SBarry Smith#     Set with CI/CD Pipelines - Run Pipeline
3542cde88bSBarry Smith      - web
3628d80369SJed Brown
3728d80369SJed Brown#
38*9c15ed49SBarry Smith#  This provides the basic order of operations and options template for cloud based stage 1 tests.
3928d80369SJed Brown#  Not all test-short need to follow this template but most will.
4028d80369SJed Brown#
4128d80369SJed Brown
42*9c15ed49SBarry Smith.stage-1:
4328d80369SJed Brown  extends: .test
44*9c15ed49SBarry Smith  stage: stage-1
4528d80369SJed Brown  image: jedbrown/mpich-ccache
46340aff75SJed Brown  before_script:
47340aff75SJed Brown    - echo nproc=$(nproc)
48340aff75SJed Brown    - cat /proc/cpuinfo
49525f0e14SJed Brown    - export CCACHE_COMPILERCHECK=content
5004bc68e0SJed Brown    - export CCACHE_DIR=$(pwd)/.ccache
5104bc68e0SJed Brown    - ccache --show-stats
5204bc68e0SJed Brown    - ccache --zero-stats
53340aff75SJed Brown  script:
541c6b2e5dSSatish Balay    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
5502e5f532SJed Brown    - make CFLAGS=-Werror
5628d80369SJed Brown    - make allgtests-tap search="${TEST_SEARCH}" TIMEOUT=300
573d889285SJed Brown  after_script:
5804bc68e0SJed Brown    - CCACHE_DIR=$(pwd)/.ccache ccache --show-stats
59e22b0966SJed Brown  artifacts:
60e22b0966SJed Brown    reports:
61e22b0966SJed Brown      junit: arch-*/tests/testresults.xml
623d889285SJed Brown  cache:
633d889285SJed Brown    paths:
6404bc68e0SJed Brown      - .ccache/
653d889285SJed Brown    key: "${CI_JOB_NAME}"
66e74c1a09SJed Brown
6728d80369SJed Brown#
6828d80369SJed Brown# The following tests run on the cloud as part of test-short.
6928d80369SJed Brown#
7028d80369SJed Brown
711c6b2e5dSSatish Balaympich-cxx-py3:
72*9c15ed49SBarry Smith  extends: .stage-1
73e74c1a09SJed Brown  variables:
741c6b2e5dSSatish Balay    PYTHON: python3
751c6b2e5dSSatish Balay    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-clanguage=cxx --with-fc=0
76e74c1a09SJed Brown    TEST_SEARCH: snes_tutorials-ex48%
77340aff75SJed Brown
78340aff75SJed Brownuni-complex-float-int64:
79*9c15ed49SBarry Smith  extends: .stage-1
80e74c1a09SJed Brown  variables:
811c6b2e5dSSatish Balay    PYTHON: python3
82e74c1a09SJed Brown    CONFIG_OPTS: <
83e74c1a09SJed Brown      --with-mpi=0
84340aff75SJed Brown      --with-scalar-type=complex --with-precision=single --with-64-bit-indices
85e74c1a09SJed Brown    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
86340aff75SJed Brown
871c6b2e5dSSatish Balayc89-mlib-static-py2:
88*9c15ed49SBarry Smith  extends: .stage-1
893d889285SJed Brown  image: jedbrown/mpich-ccache:python2
901c6b2e5dSSatish Balay  variables:
91377e4ec7SSatish Balay    PYTHON: python2
921c6b2e5dSSatish Balay    CONFIG_OPTS: <
931c6b2e5dSSatish Balay      --with-mpi-dir=/usr/local
941c6b2e5dSSatish Balay      --with-single-library=0 --with-shared-libraries=0 'CFLAGS=-std=c89 -pedantic -Wno-long-long -Wno-overlength-strings'
951c6b2e5dSSatish Balay    TEST_SEARCH: snes_tutorials-ex48%
961c6b2e5dSSatish Balay
9728d80369SJed Brown#
98*9c15ed49SBarry Smith# This provides the basic order of operations and options template for stage-2 tests.
99*9c15ed49SBarry Smith# Not all stage-2 need to follow this template, but most will.
10028d80369SJed Brown#
101*9c15ed49SBarry Smith.stage-2:
10228d80369SJed Brown  extends: .test
103*9c15ed49SBarry Smith  stage: stage-2
104410f5c6aSJed Brown  only:
1050962a0d6SJed Brown    variables:
106*9c15ed49SBarry Smith      - $STAGE != /1/
10744cd3865SJed Brown  script:
1081702e285SSatish Balay    - ./config/examples/${TEST_ARCH}.py
10944cd3865SJed Brown    - make
11044cd3865SJed Brown    - make check
1111702e285SSatish Balay    - make cleantest allgtests-tap TIMEOUT=300
1128166029eSJed Brown  artifacts:
1138166029eSJed Brown    reports:
1148166029eSJed Brown      junit: ${TEST_ARCH}/tests/testresults.xml
11544cd3865SJed Brown
11628d80369SJed Brown#
117*9c15ed49SBarry Smith# The following tests run on MCS systems as part of stage-2.
11828d80369SJed Brown#
11928d80369SJed Brown# The tags variable used in the tests below connects the particular test with the runners
12028d80369SJed Brown# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
12128d80369SJed Brown# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
12228d80369SJed Brown# any runner that has the tag (in a blue box beneath it) of mcs-linux.
12328d80369SJed Brown#
12428d80369SJed Brown
12528d80369SJed Brown.mcs_test:
126*9c15ed49SBarry Smith  extends: .stage-2
12728d80369SJed Brown
1281702e285SSatish Balay.linux_mcs_test:
1291702e285SSatish Balay  extends: .mcs_test
1301702e285SSatish Balay  tags:
1319f54a376SSatish Balay    - mcs-linux
1321702e285SSatish Balay  before_script:
1331702e285SSatish Balay    - hostname
1341702e285SSatish Balay    - grep PRETTY_NAME /etc/os-release
1351702e285SSatish Balay    - echo $(nproc)
136525f0e14SJed Brown    - ccache --zero-stats
137525f0e14SJed Brown  after_script:
138525f0e14SJed Brown    - ccache --show-stats
1391702e285SSatish Balay
1401702e285SSatish Balay.freebsd_mcs_test:
1411702e285SSatish Balay  extends: .mcs_test
1428623489dSJed Brown  tags:
1439f54a376SSatish Balay    - mcs-freebsd
1448623489dSJed Brown  before_script:
1458623489dSJed Brown    - hostname
1461702e285SSatish Balay    - freebsd-version
1471702e285SSatish Balay    - echo $(sysctl -n hw.ncpu)
148525f0e14SJed Brown    - ccache --zero-stats
149525f0e14SJed Brown  after_script:
150525f0e14SJed Brown    - ccache --show-stats
1511702e285SSatish Balay
15220099508SSatish Balay.osx_mcs_test:
15320099508SSatish Balay  extends: .mcs_test
15420099508SSatish Balay  tags:
1559f54a376SSatish Balay    - mcs-osx
156a3e7580aSSatish Balay  variables:
15728d80369SJed Brown#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
15828d80369SJed Brown#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
15928d80369SJed Brown    PETSC_OPTIONS: <
16028d80369SJed Brown      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
16128d80369SJed Brown      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
16220099508SSatish Balay  before_script:
16320099508SSatish Balay    - hostname
16420099508SSatish Balay    - sw_vers -productVersion
16520099508SSatish Balay    - echo $(sysctl -n hw.ncpu)
166525f0e14SJed Brown    - ccache --zero-stats
167525f0e14SJed Brown  after_script:
168525f0e14SJed Brown    - ccache --show-stats
16920099508SSatish Balay
17020099508SSatish Balay.opensolaris_mcs_test:
17120099508SSatish Balay  extends: .mcs_test
17220099508SSatish Balay  tags:
1739f54a376SSatish Balay    - mcs-opensolaris
17420099508SSatish Balay  before_script:
17520099508SSatish Balay    - hostname
17620099508SSatish Balay    - uname -a
17720099508SSatish Balay    - echo $(nproc)
17820099508SSatish Balay
1791702e285SSatish Balaylinux-gcc-complex-opt:
1801702e285SSatish Balay  extends: .linux_mcs_test
1811702e285SSatish Balay  variables:
1824d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-complex-opt
1831702e285SSatish Balay
1841702e285SSatish Balaylinux-gcc-pkgs-opt:
1851702e285SSatish Balay  extends: .linux_mcs_test
1861702e285SSatish Balay  variables:
1874d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
1881702e285SSatish Balay
1891702e285SSatish Balaylinux-gcc-quad-64idx-dbg:
1901702e285SSatish Balay  extends: .linux_mcs_test
1911702e285SSatish Balay  variables:
1924d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
1931702e285SSatish Balay
1941702e285SSatish Balayfreebsd-c-single-opt:
1951702e285SSatish Balay  extends: .freebsd_mcs_test
1961702e285SSatish Balay  variables:
1974d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-c-single-opt
1981702e285SSatish Balay
1991702e285SSatish Balayfreebsd-cxx-cmplx-64idx-dbg:
2001702e285SSatish Balay  extends: .freebsd_mcs_test
2011702e285SSatish Balay  variables:
2024d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
2038623489dSJed Brown
20420099508SSatish Balayosx-cxx-pkgs-opt:
20520099508SSatish Balay  extends: .osx_mcs_test
20620099508SSatish Balay  variables:
2074d09bf9bSSatish Balay    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
20820099508SSatish Balay
20920099508SSatish Balayopensolaris-cmplx-pkgs-dbg:
21020099508SSatish Balay  extends: .opensolaris_mcs_test
21120099508SSatish Balay  variables:
2124d09bf9bSSatish Balay    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
2134f89072dSBarry Smith
21428d80369SJed Brown#
21528d80369SJed Brown# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
21628d80369SJed Brown# that fail produce a warning, but do not block execution of a pipeline.
21728d80369SJed Brown#
21828d80369SJed Brown
21928d80369SJed Brown.test-experimental:
22028d80369SJed Brown  extends: .test
22128d80369SJed Brown  allow_failure: true
22228d80369SJed Brown
2234f89072dSBarry Smithbarry-checksource:
22428d80369SJed Brown  extends: .test-experimental
225*9c15ed49SBarry Smith  stage: stage-1
22628d80369SJed Brown  variables:
22728d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
22828d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
2294f89072dSBarry Smith  tags:
2304f89072dSBarry Smith    - barry
2314f89072dSBarry Smith  script:
23228d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0
23328d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` make checkbadSource
23428d80369SJed Brown
23528d80369SJed Brownbarry-arch-hash:
23628d80369SJed Brown  extends: .test-experimental
237*9c15ed49SBarry Smith  stage: stage-1
23828d80369SJed Brown  variables:
23928d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
24028d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
24128d80369SJed Brown  tags:
24228d80369SJed Brown    - barry
24328d80369SJed Brown  script:
24428d80369SJed Brown    - PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0 --arch-hash
24528d80369SJed Brown    - PETSC_DIR=`pwd` make checkbadSource
246