xref: /petsc/.gitlab-ci.yml (revision 689e46095cf61dfafcdffcabd89a0a5d90b9184b)
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
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 tests.
107# Not all stage-2 need to follow this template, but most will.
108#
109.stage-2:
110  extends: .test
111  stage: stage-2
112  only:
113    variables:
114      - $STAGE != "1"
115  script:
116    - ./config/examples/${TEST_ARCH}.py
117    - make
118    - make check
119    - make cleantest allgtests-tap TIMEOUT=300
120  artifacts:
121    reports:
122      junit: ${TEST_ARCH}/tests/testresults.xml
123
124#
125# The following tests run on MCS systems as part of stage-2.
126#
127# The tags variable used in the tests below connects the particular test with the runners
128# listed on the left hand side of https://gitlab.com/petsc/petsc/-/settings/ci_cd.
129# For example the test linux-gcc-complex-opt which extends .linux_mcs_test will run on
130# any runner that has the tag (in a blue box beneath it) of mcs-linux.
131#
132
133.mcs_test:
134  extends: .stage-2
135
136.linux_mcs_test:
137  extends: .mcs_test
138  tags:
139    - os:linux,name:pj02
140  before_script:
141    - hostname
142    - grep PRETTY_NAME /etc/os-release
143    - echo $(nproc)
144    - ccache --zero-stats
145  after_script:
146    - ccache --show-stats
147
148.freebsd_mcs_test:
149  extends: .mcs_test
150  tags:
151    - os:fbsd,name:petsc-fbsd
152  before_script:
153    - hostname
154    - freebsd-version
155    - echo $(sysctl -n hw.ncpu)
156    - ccache --zero-stats
157  after_script:
158    - ccache --show-stats
159
160.osx_mcs_test:
161  extends: .mcs_test
162  tags:
163    - os:osx,name:jpro
164  variables:
165#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
166#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
167    PETSC_OPTIONS: <
168      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
169      -saws_port_auto_select -saws_port_auto_select_silent -vecscatter_mpi1 false -options_left false
170  before_script:
171    - hostname
172    - sw_vers -productVersion
173    - echo $(sysctl -n hw.ncpu)
174    - ccache --zero-stats
175  after_script:
176    - ccache --show-stats
177
178.opensolaris_mcs_test:
179  extends: .mcs_test
180  tags:
181    - os:opensolaris,name:n-gage
182  before_script:
183    - hostname
184    - uname -a
185    - echo $(nproc)
186
187#####         These are the specific tests that map to the scripts in config/examples
188
189linux-gcc-complex-opt:
190  extends: .linux_mcs_test
191  variables:
192    TEST_ARCH: arch-ci-linux-gcc-complex-opt
193
194linux-gcc-pkgs-opt:
195  extends: .linux_mcs_test
196  variables:
197    TEST_ARCH: arch-ci-linux-gcc-pkgs-opt
198
199linux-gcc-quad-64idx-dbg:
200  extends: .linux_mcs_test
201  variables:
202    TEST_ARCH: arch-ci-linux-gcc-quad-64idx-dbg
203
204freebsd-c-single-opt:
205  extends: .freebsd_mcs_test
206  variables:
207    TEST_ARCH: arch-ci-freebsd-c-single-opt
208
209freebsd-cxx-cmplx-64idx-dbg:
210  extends: .freebsd_mcs_test
211  variables:
212    TEST_ARCH: arch-ci-freebsd-cxx-cmplx-64idx-dbg
213
214osx-cxx-pkgs-opt:
215  extends: .osx_mcs_test
216  variables:
217    TEST_ARCH: arch-ci-osx-cxx-pkgs-opt
218
219opensolaris-cmplx-pkgs-dbg:
220  extends: .opensolaris_mcs_test
221  variables:
222    TEST_ARCH: arch-ci-opensolaris-cmplx-pkgs-dbg
223
224osx-barry:
225  extends: .mcs_test
226  tags:
227    - os:osx
228  variables:
229#  the stages definition defines the first line of PETSC_OPTIONS below. Do they have to be repeated here or can one use
230#  $PETSC_OPTIONS or another option so that they do not need to be repeated?
231    PETSC_OPTIONS: <
232      -check_pointer_intensity 0 -error_output_stdout -nox -nox_warning -malloc_dump
233      -vecscatter_mpi1 false -options_left false
234    TEST_ARCH: arch-ci-osx-prefix
235  before_script:
236    - hostname
237    - sw_vers -productVersion
238    - echo $(sysctl -n hw.ncpu)
239    - ccache --zero-stats
240  after_script:
241    - ccache --show-stats
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