xref: /petsc/.gitlab-ci.yml (revision 689e46095cf61dfafcdffcabd89a0a5d90b9184b)
128d80369SJed Brown#
29c15ed49SBarry 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#
49c15ed49SBarry 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#
69c15ed49SBarry 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
79c15ed49SBarry Smith#         (not yet implemented)
804df5595SBarry Smith#
99c15ed49SBarry Smith# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
109c15ed49SBarry Smith#   You can limit the testing by using the variable STAGE with value 1 or 2
119c15ed49SBarry Smith#
129c15ed49SBarry Smith# By default the test branch is merged to master before testing. (not yet implemented)
139c15ed49SBarry Smith#   You can limite this by using the variable MERGETOMASTER with value 0 (not yet implemented)
1428d80369SJed Brown#
1528d80369SJed Brown
16340aff75SJed Brownstages:
179c15ed49SBarry Smith  - stage-1
189c15ed49SBarry Smith  - stage-2
199c15ed49SBarry 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#
269c15ed49SBarry 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:
329c15ed49SBarry Smith#     Set with CI/CD Shedules - New Schedule
339c15ed49SBarry Smith      - schedules
349c15ed49SBarry Smith#     Set with CI/CD Pipelines - Run Pipeline
3542cde88bSBarry Smith      - web
3628d80369SJed Brown
3728d80369SJed Brown#
389c15ed49SBarry 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
429c15ed49SBarry Smith.stage-1:
4328d80369SJed Brown  extends: .test
449c15ed49SBarry 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:
729c15ed49SBarry 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:
799c15ed49SBarry 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:
889c15ed49SBarry 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
97*689e4609SSatish Balaychecksource:
98*689e4609SSatish Balay  extends: .test
99*689e4609SSatish Balay  image: jedbrown/mpich-ccache
100*689e4609SSatish Balay  stage: stage-1
101*689e4609SSatish Balay  script:
102*689e4609SSatish Balay    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
103*689e4609SSatish Balay    - make checkbadSource SHELL=bash
104*689e4609SSatish Balay
10528d80369SJed Brown#
1069c15ed49SBarry Smith# This provides the basic order of operations and options template for stage-2 tests.
1079c15ed49SBarry Smith# Not all stage-2 need to follow this template, but most will.
10828d80369SJed Brown#
1099c15ed49SBarry Smith.stage-2:
11028d80369SJed Brown  extends: .test
1119c15ed49SBarry Smith  stage: stage-2
112410f5c6aSJed Brown  only:
1130962a0d6SJed Brown    variables:
114040bb367SBarry Smith      - $STAGE != "1"
11544cd3865SJed Brown  script:
1161702e285SSatish Balay    - ./config/examples/${TEST_ARCH}.py
11744cd3865SJed Brown    - make
11844cd3865SJed Brown    - make check
1191702e285SSatish Balay    - make cleantest allgtests-tap TIMEOUT=300
1208166029eSJed Brown  artifacts:
1218166029eSJed Brown    reports:
1228166029eSJed Brown      junit: ${TEST_ARCH}/tests/testresults.xml
12344cd3865SJed Brown
12428d80369SJed Brown#
1259c15ed49SBarry Smith# The following tests run on MCS systems as part of stage-2.
12628d80369SJed Brown#
12728d80369SJed Brown# The tags variable used in the tests below connects the particular test with the runners
12828d80369SJed Brown# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
12928d80369SJed Brown# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
13028d80369SJed Brown# any runner that has the tag (in a blue box beneath it) of mcs-linux.
13128d80369SJed Brown#
13228d80369SJed Brown
13328d80369SJed Brown.mcs_test:
1349c15ed49SBarry Smith  extends: .stage-2
13528d80369SJed Brown
1361702e285SSatish Balay.linux_mcs_test:
1371702e285SSatish Balay  extends: .mcs_test
1381702e285SSatish Balay  tags:
139f923398bSSatish Balay    - os:linux,name:pj02
1401702e285SSatish Balay  before_script:
1411702e285SSatish Balay    - hostname
1421702e285SSatish Balay    - grep PRETTY_NAME /etc/os-release
1431702e285SSatish Balay    - echo $(nproc)
144525f0e14SJed Brown    - ccache --zero-stats
145525f0e14SJed Brown  after_script:
146525f0e14SJed Brown    - ccache --show-stats
1471702e285SSatish Balay
1481702e285SSatish Balay.freebsd_mcs_test:
1491702e285SSatish Balay  extends: .mcs_test
1508623489dSJed Brown  tags:
151f923398bSSatish Balay    - os:fbsd,name:petsc-fbsd
1528623489dSJed Brown  before_script:
1538623489dSJed Brown    - hostname
1541702e285SSatish Balay    - freebsd-version
1551702e285SSatish Balay    - echo $(sysctl -n hw.ncpu)
156525f0e14SJed Brown    - ccache --zero-stats
157525f0e14SJed Brown  after_script:
158525f0e14SJed Brown    - ccache --show-stats
1591702e285SSatish Balay
16020099508SSatish Balay.osx_mcs_test:
16120099508SSatish Balay  extends: .mcs_test
16220099508SSatish Balay  tags:
163f923398bSSatish Balay    - os:osx,name:jpro
164a3e7580aSSatish Balay  variables:
16528d80369SJed Brown#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
16628d80369SJed Brown#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
16728d80369SJed Brown    PETSC_OPTIONS: <
16828d80369SJed Brown      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
16928d80369SJed Brown      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
17020099508SSatish Balay  before_script:
17120099508SSatish Balay    - hostname
17220099508SSatish Balay    - sw_vers -productVersion
17320099508SSatish Balay    - echo $(sysctl -n hw.ncpu)
174525f0e14SJed Brown    - ccache --zero-stats
175525f0e14SJed Brown  after_script:
176525f0e14SJed Brown    - ccache --show-stats
17720099508SSatish Balay
17820099508SSatish Balay.opensolaris_mcs_test:
17920099508SSatish Balay  extends: .mcs_test
18020099508SSatish Balay  tags:
181f923398bSSatish Balay    - os:opensolaris,name:n-gage
18220099508SSatish Balay  before_script:
18320099508SSatish Balay    - hostname
18420099508SSatish Balay    - uname -a
18520099508SSatish Balay    - echo $(nproc)
18620099508SSatish Balay
187f923398bSSatish Balay#####         These are the specific tests that map to the scripts in config/examples
188f923398bSSatish Balay
1891702e285SSatish Balaylinux-gcc-complex-opt:
1901702e285SSatish Balay  extends: .linux_mcs_test
1911702e285SSatish Balay  variables:
1924d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-complex-opt
1931702e285SSatish Balay
1941702e285SSatish Balaylinux-gcc-pkgs-opt:
1951702e285SSatish Balay  extends: .linux_mcs_test
1961702e285SSatish Balay  variables:
1974d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
1981702e285SSatish Balay
1991702e285SSatish Balaylinux-gcc-quad-64idx-dbg:
2001702e285SSatish Balay  extends: .linux_mcs_test
2011702e285SSatish Balay  variables:
2024d09bf9bSSatish Balay    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
2031702e285SSatish Balay
2041702e285SSatish Balayfreebsd-c-single-opt:
2051702e285SSatish Balay  extends: .freebsd_mcs_test
2061702e285SSatish Balay  variables:
2074d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-c-single-opt
2081702e285SSatish Balay
2091702e285SSatish Balayfreebsd-cxx-cmplx-64idx-dbg:
2101702e285SSatish Balay  extends: .freebsd_mcs_test
2111702e285SSatish Balay  variables:
2124d09bf9bSSatish Balay    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
2138623489dSJed Brown
21420099508SSatish Balayosx-cxx-pkgs-opt:
21520099508SSatish Balay  extends: .osx_mcs_test
21620099508SSatish Balay  variables:
2174d09bf9bSSatish Balay    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
21820099508SSatish Balay
21920099508SSatish Balayopensolaris-cmplx-pkgs-dbg:
22020099508SSatish Balay  extends: .opensolaris_mcs_test
22120099508SSatish Balay  variables:
2224d09bf9bSSatish Balay    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
2234f89072dSBarry Smith
224f923398bSSatish Balayosx-barry:
225f923398bSSatish Balay  extends: .mcs_test
226f923398bSSatish Balay  tags:
227f923398bSSatish Balay    - os:osx
228f923398bSSatish Balay  variables:
229f923398bSSatish Balay#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
230f923398bSSatish Balay#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
231f923398bSSatish Balay    PETSC_OPTIONS: <
232f923398bSSatish Balay      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
233f923398bSSatish Balay      -vecscatter_mpi1 false -options_left false
234f923398bSSatish Balay    TEST_ARCH: arch-ci-osx-prefix
235f923398bSSatish Balay  before_script:
236f923398bSSatish Balay    - hostname
237f923398bSSatish Balay    - sw_vers -productVersion
238f923398bSSatish Balay    - echo $(sysctl -n hw.ncpu)
239f923398bSSatish Balay    - ccache --zero-stats
240f923398bSSatish Balay  after_script:
241f923398bSSatish Balay    - ccache --show-stats
242f923398bSSatish Balay
24328d80369SJed Brown#
24428d80369SJed Brown# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
24528d80369SJed Brown# that fail produce a warning, but do not block execution of a pipeline.
24628d80369SJed Brown#
24728d80369SJed Brown
24828d80369SJed Brown.test-experimental:
24928d80369SJed Brown  extends: .test
25028d80369SJed Brown  allow_failure: true
25128d80369SJed Brown
252