xref: /petsc/.gitlab-ci.yml (revision 77bbc694f770770f8906fa64f24d3377e7dbcc95)
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 stage-1.
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
97checksource:
98  extends: .test
99  image: jedbrown/mpich-ccache
100  stage: stage-1
101  script:
102    - python3 ./configure --with-mpi=0 --with-fc=0 --with-cxx=0
103    - make checkbadSource SHELL=bash
104
105#
106# This provides the basic order of operations and options template for stage-2,3 tests.
107# Not all stage-2,3 need to follow this template, but most will.
108#
109.stage-23:
110  extends: .test
111  script:
112    - printf "$PATH\n"
113    - printf "./config/examples/${TEST_ARCH}.py\n"
114    - cat ./config/examples/${TEST_ARCH}.py
115    - ./config/examples/${TEST_ARCH}.py
116    - make
117    - make check
118    - make cleantest allgtests-tap TIMEOUT=300
119  artifacts:
120    reports:
121      junit: ${TEST_ARCH}/tests/testresults.xml
122
123.stage-2:
124  extends: .stage-23
125  stage: stage-2
126  only:
127    variables:
128      - $STAGE != "1"
129      - $STAGE != "3"
130
131.stage-3:
132  extends: .stage-23
133  stage: stage-3
134  only:
135    variables:
136      - $STAGE != "1"
137      - $STAGE != "2"
138
139#
140# The following provide templates for various OSes for pre/post info
141#
142
143.linux_test:
144  before_script:
145    - hostname
146    - grep PRETTY_NAME /etc/os-release
147    - echo $(nproc)
148    - ccache --zero-stats
149  after_script:
150    - ccache --show-stats
151
152.freebsd_test:
153  before_script:
154    - hostname
155    - freebsd-version
156    - echo $(sysctl -n hw.ncpu)
157    - ccache --zero-stats
158  after_script:
159    - ccache --show-stats
160
161.osx_test:
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_test:
171  before_script:
172    - hostname
173    - uname -a
174    - echo $(nproc)
175
176.mswin_test:
177  before_script:
178    - hostname
179    - uname -a
180    - echo $(nproc)
181
182#
183# The following tests run as part of stage-2.
184#
185# The tags variable used in the tests below connects the particular test with the runners
186# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
187# For example the test linux-gcc-complex-opt  any runner that has the tag 'name:pj02'
188# (in a blue box beneath it)
189#
190
191linux-gcc-complex-opt:
192  extends:
193    - .stage-2
194    - .linux_test
195  tags:
196    - name:pj02
197  variables:
198    TEST_ARCH: arch-ci-linux-gcc-complex-opt
199
200linux-gcc-pkgs-opt:
201  extends:
202    - .stage-2
203    - .linux_test
204  tags:
205    - name:pj02
206  variables:
207    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
208
209linux-gcc-quad-64idx-dbg:
210  extends:
211    - .stage-2
212    - .linux_test
213  tags:
214    - name:pj02
215  variables:
216    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
217
218freebsd-c-single-opt:
219  extends:
220    - .stage-2
221    - .freebsd_test
222  tags:
223    - os:fbsd
224  variables:
225    TEST_ARCH: arch-ci-freebsd-c-single-opt
226
227freebsd-cxx-cmplx-64idx-dbg:
228  extends:
229    - .stage-2
230    - .freebsd_test
231  tags:
232    - name:petsc-fbsd
233  variables:
234    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
235
236opensolaris-misc:
237  extends:
238    - .stage-2
239    - .opensolaris_test
240  tags:
241    - name:n-gage
242  variables:
243    TEST_ARCH: arch-ci-opensolaris-misc
244
245osx-cxx-pkgs-opt:
246  extends:
247    - .stage-2
248    - .osx_test
249  tags:
250    - name:jpro
251  variables:
252    PETSC_OPTIONS: <
253      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
254      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
255    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
256
257osx-barry:
258  extends:
259    - .stage-2
260    - .osx_test
261  tags:
262    - os:osx
263  variables:
264    TEST_ARCH: arch-ci-osx-prefix
265
266mswin-uni:
267  extends:
268    - .stage-2
269    - .mswin_test
270  tags:
271    - name:ps4
272  variables:
273    TEST_ARCH: arch-ci-mswin-uni
274
275#
276# The following tests run as part of stage-3.
277#
278
279mswin-intel-cxx-cmplx:
280  extends:
281    - .stage-3
282    - .mswin_test
283  tags:
284    - name:ps4
285  variables:
286    TEST_ARCH: arch-ci-mswin-intel-cxx-cmplx
287
288mswin-intel:
289  extends:
290    - .stage-3
291    - .mswin_test
292  tags:
293    - name:ps4
294  variables:
295    TEST_ARCH: arch-ci-mswin-intel
296
297arch-ci-mswin-opt-impi:
298  extends:
299    - .stage-3
300    - .mswin_test
301  tags:
302    - name:ps4
303  variables:
304    TEST_ARCH: arch-ci-mswin-opt-impi
305
306
307opensolaris-cmplx-pkgs-dbg:
308  extends:
309    - .stage-3
310    - .opensolaris_test
311  tags:
312    - name:n-gage
313  variables:
314    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
315
316opensolaris-pkgs-opt:
317  extends:
318    - .stage-3
319    - .opensolaris_test
320  tags:
321    - name:n-gage
322  variables:
323    TEST_ARCH: arch-ci-opensolaris-pkgs-opt
324
325freebsd-pkgs-opt:
326  extends:
327    - .stage-3
328    - .freebsd_test
329  tags:
330    - os:fbsd
331  variables:
332    TEST_ARCH: arch-ci-freebsd-pkgs-opt
333
334freebsd-cxx-cmplx-pkgs-dbg:
335  extends:
336    - .stage-3
337    - .freebsd_test
338  tags:
339    - os:fbsd
340  variables:
341    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-pkgs-dbg
342
343freebsd-cxx-pkgs-opt:
344  extends:
345    - .stage-3
346    - .freebsd_test
347  tags:
348    - os:fbsd
349  variables:
350    PETSC_OPTIONS: <
351      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
352      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
353  variables:
354    TEST_ARCH: arch-ci-freebsd-cxx-pkgs-opt
355
356osx-cxx-cmplx-pkgs-dbg:
357  extends:
358    - .stage-3
359    - .osx_test
360  tags:
361    - os:osx,name:jpro
362  variables:
363    TEST_ARCH: arch-ci-osx-cxx-cmplx-pkgs-dbg
364
365osx-dbg:
366  extends:
367    - .stage-3
368    - .osx_test
369  tags:
370    - os:osx
371  variables:
372    TEST_ARCH: arch-ci-osx-dbg
373
374osx-xsdk-opt:
375  extends:
376    - .stage-3
377    - .osx_test
378  tags:
379    - os:osx
380  variables:
381    TEST_ARCH: arch-ci-osx-xsdk-opt
382
383#
384# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
385# that fail produce a warning, but do not block execution of a pipeline.
386#
387
388.test-experimental:
389  extends: .test
390  allow_failure: true
391
392