xref: /petsc/.gitlab-ci.yml (revision 3e0a28c5c4d087b8062e48debfba00969ccf6e8b)
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    - ./config/examples/${TEST_ARCH}.py
113    - make
114    - make check
115    - make cleantest allgtests-tap TIMEOUT=300
116  artifacts:
117    reports:
118      junit: ${TEST_ARCH}/tests/testresults.xml
119
120.stage-2:
121  extends: .stage-23
122  stage: stage-2
123  only:
124    variables:
125      - $STAGE != "1"
126      - $STAGE != "3"
127
128.stage-3:
129  extends: .stage-23
130  stage: stage-3
131  only:
132    variables:
133      - $STAGE != "1"
134      - $STAGE != "2"
135
136#
137# The following provide templates for various OSes for pre/post info
138#
139
140.linux_test:
141  before_script:
142    - hostname
143    - grep PRETTY_NAME /etc/os-release
144    - echo $(nproc)
145    - ccache --zero-stats
146  after_script:
147    - ccache --show-stats
148
149.freebsd_test:
150  before_script:
151    - hostname
152    - freebsd-version
153    - echo $(sysctl -n hw.ncpu)
154    - ccache --zero-stats
155  after_script:
156    - ccache --show-stats
157
158.osx_test:
159  before_script:
160    - hostname
161    - sw_vers -productVersion
162    - echo $(sysctl -n hw.ncpu)
163    - ccache --zero-stats
164  after_script:
165    - ccache --show-stats
166
167.opensolaris_test:
168  before_script:
169    - hostname
170    - uname -a
171    - echo $(nproc)
172
173#
174# The following tests run as part of stage-2.
175#
176# The tags variable used in the tests below connects the particular test with the runners
177# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
178# For example the test linux-gcc-complex-opt  any runner that has the tag 'name:pj02'
179# (in a blue box beneath it)
180#
181
182linux-gcc-complex-opt:
183  extends:
184    - .stage-2
185    - .linux_test
186  tags:
187    - name:pj02
188  variables:
189    TEST_ARCH: arch-ci-linux-gcc-complex-opt
190
191linux-gcc-pkgs-opt:
192  extends:
193    - .stage-2
194    - .linux_test
195  tags:
196    - name:pj02
197  variables:
198    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
199
200linux-gcc-quad-64idx-dbg:
201  extends:
202    - .stage-2
203    - .linux_test
204  tags:
205    - name:pj02
206  variables:
207    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
208
209freebsd-c-single-opt:
210  extends:
211    - .stage-2
212    - .freebsd_test
213  tags:
214    - name:petsc-fbsd
215  variables:
216    TEST_ARCH: arch-ci-freebsd-c-single-opt
217
218freebsd-cxx-cmplx-64idx-dbg:
219  extends:
220    - .stage-2
221    - .freebsd_test
222  tags:
223    - name:petsc-fbsd
224  variables:
225    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
226
227opensolaris-cmplx-pkgs-dbg:
228  extends:
229    - .stage-2
230    - .opensolaris_test
231  tags:
232    - name:n-gage
233  variables:
234    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
235
236osx-cxx-pkgs-opt:
237  extends:
238    - .stage-2
239    - .osx_test
240  tags:
241    - name:jpro
242  variables:
243    PETSC_OPTIONS: <
244      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
245      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
246    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
247
248osx-barry:
249  extends:
250    - .stage-2
251    - .osx_test
252  tags:
253    - os:osx
254  variables:
255    TEST_ARCH: arch-ci-osx-prefix
256
257#
258# The following tests are experimental; more tests by users at other sites may be added below this.  Experimental test
259# that fail produce a warning, but do not block execution of a pipeline.
260#
261
262.test-experimental:
263  extends: .test
264  allow_failure: true
265
266