xref: /petsc/.gitlab-ci.yml (revision 04df559530e8bea6c26d33b7fb54067ac1270365)
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
7*04df5595SBarry Smith# been labeled with "fulltest". You must do a commit/push on the branch to force the testing after you have added the label.
8*04df5595SBarry Smith# To provide an empty commit that forces a new pipeline you can use
9*04df5595SBarry Smith#    git commit --amend --no-edit  # updates CommitDate field
10*04df5595SBarry Smith#    git push origin +my/branch    # force push amended commit
11*04df5595SBarry Smith#
12*04df5595SBarry Smith# You can also trigger  a fulltest by using the Run Pipeline button and providing the variable CI_MERGE_REQUEST_LABELS with
13*04df5595SBarry Smith# the value fulltest. Using the Run Pipeline button with no variable will trigger a test-short
14*04df5595SBarry Smith#
15*04df5595SBarry Smith# Note that using the Run Pipeline or a WIP does NOT merge the branch into master before testing
16*04df5595SBarry Smith# https://docs.gitlab.com/ee/ci/merge_request_pipelines/   It is only merged to master after the WIP is removed and it becomes a
17*04df5595SBarry Smith# real MR. I am inclined to say we should manually do the merge to master in the scripts below
18*04df5595SBarry Smith# before running the tests. Or maybe have a label mergetomaster Barry Smith
1928d80369SJed Brown#
2028d80369SJed Brown
21340aff75SJed Brownstages:
2228d80369SJed Brown  - test-short
23636284c1SSatish Balay  - test-long
24340aff75SJed Brownvariables:
25340aff75SJed Brown  GIT_STRATEGY: fetch
26c592e2e1SSatish Balay  GIT_CLEAN_FLAGS: -ffdxq
27a3e7580aSSatish Balay  PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
28340aff75SJed Brown
2928d80369SJed Brown#
3028d80369SJed Brown# The most basic template that most tests will expand upon. It ensures that the tests are run only for merge requests.
3128d80369SJed Brown#
3228d80369SJed Brown
33e74c1a09SJed Brown.test:
34410f5c6aSJed Brown  only:
350962a0d6SJed Brown    refs:
36410f5c6aSJed Brown      - merge_requests
3742cde88bSBarry Smith      - web
3828d80369SJed Brown
3928d80369SJed Brown#
4028d80369SJed Brown#  This provides the basic order of operations and options template for cloud based test-short tests.
4128d80369SJed Brown#  Not all test-short need to follow this template but most will.
4228d80369SJed Brown#
4328d80369SJed Brown
4428d80369SJed Brown.test-short:
4528d80369SJed Brown  extends: .test
4628d80369SJed Brown  stage: test-short
4728d80369SJed Brown  image: jedbrown/mpich-ccache
48340aff75SJed Brown  before_script:
49340aff75SJed Brown    - echo nproc=$(nproc)
50340aff75SJed Brown    - cat /proc/cpuinfo
51525f0e14SJed Brown    - export CCACHE_COMPILERCHECK=content
5204bc68e0SJed Brown    - export CCACHE_DIR=$(pwd)/.ccache
5304bc68e0SJed Brown    - ccache --show-stats
5404bc68e0SJed Brown    - ccache --zero-stats
55340aff75SJed Brown  script:
561c6b2e5dSSatish Balay    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
5702e5f532SJed Brown    - make CFLAGS=-Werror
5828d80369SJed Brown    - make allgtests-tap search="${TEST_SEARCH}" TIMEOUT=300
593d889285SJed Brown  after_script:
6004bc68e0SJed Brown    - CCACHE_DIR=$(pwd)/.ccache ccache --show-stats
61e22b0966SJed Brown  artifacts:
62e22b0966SJed Brown    reports:
63e22b0966SJed Brown      junit: arch-*/tests/testresults.xml
643d889285SJed Brown  cache:
653d889285SJed Brown    paths:
6604bc68e0SJed Brown      - .ccache/
673d889285SJed Brown    key: "${CI_JOB_NAME}"
68e74c1a09SJed Brown
6928d80369SJed Brown#
7028d80369SJed Brown# The following tests run on the cloud as part of test-short.
7128d80369SJed Brown#
7228d80369SJed Brown
731c6b2e5dSSatish Balaympich-cxx-py3:
7428d80369SJed Brown  extends: .test-short
75e74c1a09SJed Brown  variables:
761c6b2e5dSSatish Balay    PYTHON: python3
771c6b2e5dSSatish Balay    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-clanguage=cxx --with-fc=0
78e74c1a09SJed Brown    TEST_SEARCH: snes_tutorials-ex48%
79340aff75SJed Brown
80340aff75SJed Brownuni-complex-float-int64:
8128d80369SJed Brown  extends: .test-short
82e74c1a09SJed Brown  variables:
831c6b2e5dSSatish Balay    PYTHON: python3
84e74c1a09SJed Brown    CONFIG_OPTS: <
85e74c1a09SJed Brown      --with-mpi=0
86340aff75SJed Brown      --with-scalar-type=complex --with-precision=single --with-64-bit-indices
87e74c1a09SJed Brown    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
88340aff75SJed Brown
891c6b2e5dSSatish Balayc89-mlib-static-py2:
9028d80369SJed Brown  extends: .test-short
913d889285SJed Brown  image: jedbrown/mpich-ccache:python2
921c6b2e5dSSatish Balay  variables:
93377e4ec7SSatish Balay    PYTHON: python2
941c6b2e5dSSatish Balay    CONFIG_OPTS: <
951c6b2e5dSSatish Balay      --with-mpi-dir=/usr/local
961c6b2e5dSSatish Balay      --with-single-library=0 --with-shared-libraries=0 'CFLAGS=-std=c89 -pedantic -Wno-long-long -Wno-overlength-strings'
971c6b2e5dSSatish Balay    TEST_SEARCH: snes_tutorials-ex48%
981c6b2e5dSSatish Balay
9928d80369SJed Brown#
10028d80369SJed Brown# This provides the basic order of operations and options template for test-long tests.
10128d80369SJed Brown# Not all test-long need to follow this template, but most will.
10228d80369SJed Brown#
10328d80369SJed Brown.test-long:
10428d80369SJed Brown  extends: .test
105636284c1SSatish Balay  stage: test-long
106410f5c6aSJed Brown  only:
1070962a0d6SJed Brown    variables:
1080962a0d6SJed Brown      - $CI_MERGE_REQUEST_LABELS =~ /fulltest/
10944cd3865SJed Brown  script:
1101702e285SSatish Balay    - ./config/examples/${TEST_ARCH}.py
11144cd3865SJed Brown    - make
11244cd3865SJed Brown    - make check
1131702e285SSatish Balay    - make cleantest allgtests-tap TIMEOUT=300
1148166029eSJed Brown  artifacts:
1158166029eSJed Brown    reports:
1168166029eSJed Brown      junit: ${TEST_ARCH}/tests/testresults.xml
11744cd3865SJed Brown
11828d80369SJed Brown#
11928d80369SJed Brown# The following tests run on MCS systems as part of test-long.
12028d80369SJed Brown#
12128d80369SJed Brown# The tags variable used in the tests below connects the particular test with the runners
12228d80369SJed Brown# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
12328d80369SJed Brown# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
12428d80369SJed Brown# any runner that has the tag (in a blue box beneath it) of mcs-linux.
12528d80369SJed Brown#
12628d80369SJed Brown
12728d80369SJed Brown.mcs_test:
12828d80369SJed Brown  extends: .test-long
12928d80369SJed Brown
1301702e285SSatish Balay.linux_mcs_test:
1311702e285SSatish Balay  extends: .mcs_test
1321702e285SSatish Balay  tags:
1339f54a376SSatish Balay    - mcs-linux
1341702e285SSatish Balay  before_script:
1351702e285SSatish Balay    - hostname
1361702e285SSatish Balay    - grep PRETTY_NAME /etc/os-release
1371702e285SSatish Balay    - echo $(nproc)
138525f0e14SJed Brown    - ccache --zero-stats
139525f0e14SJed Brown  after_script:
140525f0e14SJed Brown    - ccache --show-stats
1411702e285SSatish Balay
1421702e285SSatish Balay.freebsd_mcs_test:
1431702e285SSatish Balay  extends: .mcs_test
1448623489dSJed Brown  tags:
1459f54a376SSatish Balay    - mcs-freebsd
1468623489dSJed Brown  before_script:
1478623489dSJed Brown    - hostname
1481702e285SSatish Balay    - freebsd-version
1491702e285SSatish Balay    - echo $(sysctl -n hw.ncpu)
150525f0e14SJed Brown    - ccache --zero-stats
151525f0e14SJed Brown  after_script:
152525f0e14SJed Brown    - ccache --show-stats
1531702e285SSatish Balay
15420099508SSatish Balay.osx_mcs_test:
15520099508SSatish Balay  extends: .mcs_test
15620099508SSatish Balay  tags:
1579f54a376SSatish Balay    - mcs-osx
158a3e7580aSSatish Balay  variables:
15928d80369SJed Brown#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
16028d80369SJed Brown#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
16128d80369SJed Brown    PETSC_OPTIONS: <
16228d80369SJed Brown      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
16328d80369SJed Brown      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
16420099508SSatish Balay  before_script:
16520099508SSatish Balay    - hostname
16620099508SSatish Balay    - sw_vers -productVersion
16720099508SSatish Balay    - echo $(sysctl -n hw.ncpu)
168525f0e14SJed Brown    - ccache --zero-stats
169525f0e14SJed Brown  after_script:
170525f0e14SJed Brown    - ccache --show-stats
17120099508SSatish Balay
17220099508SSatish Balay.opensolaris_mcs_test:
17320099508SSatish Balay  extends: .mcs_test
17420099508SSatish Balay  tags:
1759f54a376SSatish Balay    - mcs-opensolaris
17620099508SSatish Balay  before_script:
17720099508SSatish Balay    - hostname
17820099508SSatish Balay    - uname -a
17920099508SSatish Balay    - echo $(nproc)
18020099508SSatish Balay
1811702e285SSatish Balaylinux-gcc-complex-opt:
1821702e285SSatish Balay  extends: .linux_mcs_test
1831702e285SSatish Balay  variables:
1844d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-complex-opt
1851702e285SSatish Balay
1861702e285SSatish Balaylinux-gcc-pkgs-opt:
1871702e285SSatish Balay  extends: .linux_mcs_test
1881702e285SSatish Balay  variables:
1894d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
1901702e285SSatish Balay
1911702e285SSatish Balaylinux-gcc-quad-64idx-dbg:
1921702e285SSatish Balay  extends: .linux_mcs_test
1931702e285SSatish Balay  variables:
1944d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
1951702e285SSatish Balay
1961702e285SSatish Balayfreebsd-c-single-opt:
1971702e285SSatish Balay  extends: .freebsd_mcs_test
1981702e285SSatish Balay  variables:
1994d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-c-single-opt
2001702e285SSatish Balay
2011702e285SSatish Balayfreebsd-cxx-cmplx-64idx-dbg:
2021702e285SSatish Balay  extends: .freebsd_mcs_test
2031702e285SSatish Balay  variables:
2044d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
2058623489dSJed Brown
20620099508SSatish Balayosx-cxx-pkgs-opt:
20720099508SSatish Balay  extends: .osx_mcs_test
20820099508SSatish Balay  variables:
2094d09bf9bSSatish Balay    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
21020099508SSatish Balay
21120099508SSatish Balayopensolaris-cmplx-pkgs-dbg:
21220099508SSatish Balay  extends: .opensolaris_mcs_test
21320099508SSatish Balay  variables:
2144d09bf9bSSatish Balay    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
2154f89072dSBarry Smith
21628d80369SJed Brown#
21728d80369SJed Brown# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
21828d80369SJed Brown# that fail produce a warning, but do not block execution of a pipeline.
21928d80369SJed Brown#
22028d80369SJed Brown
22128d80369SJed Brown.test-experimental:
22228d80369SJed Brown  extends: .test
22328d80369SJed Brown  allow_failure: true
22428d80369SJed Brown
2254f89072dSBarry Smithbarry-checksource:
22628d80369SJed Brown  extends: .test-experimental
22728d80369SJed Brown  stage: test-short
22828d80369SJed Brown  variables:
22928d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
23028d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
2314f89072dSBarry Smith  tags:
2324f89072dSBarry Smith    - barry
2334f89072dSBarry Smith  script:
23428d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0
23528d80369SJed Brown    - PETSC_ARCH=arch-barry PETSC_DIR=`pwd` make checkbadSource
23628d80369SJed Brown
23728d80369SJed Brownbarry-arch-hash:
23828d80369SJed Brown  extends: .test-experimental
23928d80369SJed Brown  stage: test-short
24028d80369SJed Brown  variables:
24128d80369SJed Brown# the blank GIT_CLEAN_FLAGS below indicates that the CI should NOT clean the git directory before running the next test
24228d80369SJed Brown    GIT_CLEAN_FLAGS: -qn
24328d80369SJed Brown  tags:
24428d80369SJed Brown    - barry
24528d80369SJed Brown  script:
24628d80369SJed Brown    - PETSC_DIR=`pwd` ./configure --with-mpi=0 --with-fc=0 --arch-hash
24728d80369SJed Brown    - PETSC_DIR=`pwd` make checkbadSource
248