xref: /petsc/.gitlab-ci.yml (revision e6e6d46311cff959b45037a5e8d8d5b91b4914e6)
1#
2# stage-1 take only a few minutes and generally run on the cloud; they do not run the full test suite or external packages.
3#
4# 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
5#
6# 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#         (not yet implemented)
8#
9# The stage-(n) tests are only started if all of the stage-(n-1) tests run without error
10#   You can limit the testing by using the variable STAGE with value 1 or 2
11#
12# By default the test branch is merged to master before testing. (not yet implemented)
13#   You can limite this by using the variable MERGETOMASTER with value 0 (not yet implemented)
14#
15
16stages:
17  - stage-1
18  - stage-2
19  - stage-3
20variables:
21  GIT_STRATEGY: fetch
22  GIT_CLEAN_FLAGS: -ffdxq
23  PETSC_OPTIONS: -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
24
25#
26# The most basic template that most tests will expand upon. In particular merge requests and branch pushes DO NOT trigger testing
27#
28
29.test:
30  only:
31    refs:
32#     Set with CI/CD Shedules - New Schedule
33      - schedules
34#     Set with CI/CD Pipelines - Run Pipeline
35      - web
36
37#
38#  This provides the basic order of operations and options template for cloud based stage 1 tests.
39#  Not all test-short need to follow this template but most will.
40#
41
42.stage-1:
43  extends: .test
44  stage: stage-1
45  image: jedbrown/mpich-ccache
46  before_script:
47    - echo nproc=$(nproc)
48    - cat /proc/cpuinfo
49    - export CCACHE_COMPILERCHECK=content
50    - export CCACHE_DIR=$(pwd)/.ccache
51    - ccache --show-stats
52    - ccache --zero-stats
53  script:
54    - ${PYTHON} ./configure --with-debugging=0 COPTFLAGS='-O -march=native' CXXOPTFLAGS='-O -march=native' FOPTFLAGS='-O -march=native' ${CONFIG_OPTS}
55    - make CFLAGS=-Werror
56    - make allgtests-tap search="${TEST_SEARCH}" TIMEOUT=300
57  after_script:
58    - CCACHE_DIR=$(pwd)/.ccache ccache --show-stats
59  artifacts:
60    reports:
61      junit: arch-*/tests/testresults.xml
62  cache:
63    paths:
64      - .ccache/
65    key: "${CI_JOB_NAME}"
66
67#
68# The following tests run on the cloud as part of test-short.
69#
70
71mpich-cxx-py3:
72  extends: .stage-1
73  variables:
74    PYTHON: python3
75    CONFIG_OPTS: --with-mpi-dir=/usr/local --with-clanguage=cxx --with-fc=0
76    TEST_SEARCH: snes_tutorials-ex48%
77
78uni-complex-float-int64:
79  extends: .stage-1
80  variables:
81    PYTHON: python3
82    CONFIG_OPTS: <
83      --with-mpi=0
84      --with-scalar-type=complex --with-precision=single --with-64-bit-indices
85    TEST_SEARCH: ts_tutorials-ex11_adv_2d_quad_%
86
87c89-mlib-static-py2:
88  extends: .stage-1
89  image: jedbrown/mpich-ccache:python2
90  variables:
91    PYTHON: python2
92    CONFIG_OPTS: <
93      --with-mpi-dir=/usr/local
94      --with-single-library=0 --with-shared-libraries=0 'CFLAGS=-std=c89 -pedantic -Wno-long-long -Wno-overlength-strings'
95    TEST_SEARCH: snes_tutorials-ex48%
96
97#
98# This provides the basic order of operations and options template for stage-2 tests.
99# Not all stage-2 need to follow this template, but most will.
100#
101.stage-2:
102  extends: .test
103  stage: stage-2
104  only:
105    variables:
106      - $STAGE != "1"
107  script:
108    - ./config/examples/${TEST_ARCH}.py
109    - make
110    - make check
111    - make cleantest allgtests-tap TIMEOUT=300
112  artifacts:
113    reports:
114      junit: ${TEST_ARCH}/tests/testresults.xml
115
116#
117# The following tests run on MCS systems as part of stage-2.
118#
119# The tags variable used in the tests below connects the particular test with the runners
120# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
121# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
122# any runner that has the tag (in a blue box beneath it) of mcs-linux.
123#
124
125.mcs_test:
126  extends: .stage-2
127
128.linux_mcs_test:
129  extends: .mcs_test
130  tags:
131    - os:linux,name:pj02
132  before_script:
133    - hostname
134    - grep PRETTY_NAME /etc/os-release
135    - echo $(nproc)
136    - ccache --zero-stats
137  after_script:
138    - ccache --show-stats
139
140.freebsd_mcs_test:
141  extends: .mcs_test
142  tags:
143    - os:fbsd,name:petsc-fbsd
144  before_script:
145    - hostname
146    - freebsd-version
147    - echo $(sysctl -n hw.ncpu)
148    - ccache --zero-stats
149  after_script:
150    - ccache --show-stats
151
152.osx_mcs_test:
153  extends: .mcs_test
154  tags:
155    - os:osx,name:jpro
156  variables:
157#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
158#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
159    PETSC_OPTIONS: <
160      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
161      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
162  before_script:
163    - hostname
164    - sw_vers -productVersion
165    - echo $(sysctl -n hw.ncpu)
166    - ccache --zero-stats
167  after_script:
168    - ccache --show-stats
169
170.opensolaris_mcs_test:
171  extends: .mcs_test
172  tags:
173    - os:opensolaris,name:n-gage
174  before_script:
175    - hostname
176    - uname -a
177    - echo $(nproc)
178
179#####         These are the specific tests that map to the scripts in config/examples
180
181linux-gcc-complex-opt:
182  extends: .linux_mcs_test
183  variables:
184    TEST_ARCH: arch-ci-linux-gcc-complex-opt
185
186linux-gcc-pkgs-opt:
187  extends: .linux_mcs_test
188  variables:
189    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
190
191linux-gcc-quad-64idx-dbg:
192  extends: .linux_mcs_test
193  variables:
194    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
195
196freebsd-c-single-opt:
197  extends: .freebsd_mcs_test
198  variables:
199    TEST_ARCH: arch-ci-freebsd-c-single-opt
200
201freebsd-cxx-cmplx-64idx-dbg:
202  extends: .freebsd_mcs_test
203  variables:
204    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
205
206osx-cxx-pkgs-opt:
207  extends: .osx_mcs_test
208  variables:
209    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
210
211opensolaris-cmplx-pkgs-dbg:
212  extends: .opensolaris_mcs_test
213  variables:
214    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
215
216osx-barry:
217  extends: .mcs_test
218  tags:
219    - os:osx
220  variables:
221#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
222#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
223    PETSC_OPTIONS: <
224      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
225      -vecscatter_mpi1 false -options_left false
226    TEST_ARCH: arch-ci-osx-prefix
227  before_script:
228    - hostname
229    - sw_vers -productVersion
230    - echo $(sysctl -n hw.ncpu)
231    - ccache --zero-stats
232  after_script:
233    - ccache --show-stats
234
235checksource:
236  extends: .test
237  stage: stage-1
238  script:
239    - ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
240    - make checkbadSource
241
242
243#
244# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
245# that fail produce a warning, but do not block execution of a pipeline.
246#
247
248.test-experimental:
249  extends: .test
250  allow_failure: true
251
252