Newer
Older
# This file is a template, and might need editing before it works on your project.
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
#
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
image: "${CI_TEMPLATE_REGISTRY_HOST}/pages/ngmultiscale:latest"
stages: # List of stages for jobs, and their order of execution
- build
- test
# build-ngsolve-job: # This job runs in the build stage, which runs first.
# stage: build
# image: python:3.10
# before_script:
# - apt-get update -q -y
# - apt-get -y install python3 python3-distutils python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev liblapacke-dev libocct-data-exchange-dev libocct-draw-dev occt-misc libtbb-dev libxi-dev
# script:
# - pwd
# - export BASEDIR=/builds/valentin.hanser/ngmultiscale/ngsuite
# - echo $BASEDIR
# - mkdir -p $BASEDIR
# - cd $BASEDIR && git clone https://github.com/NGSolve/ngsolve.git ngsolve-src
# - cd $BASEDIR/ngsolve-src && git submodule update --init --recursive
# - mkdir $BASEDIR/ngsolve-build
# - mkdir $BASEDIR/ngsolve-install
# - cd $BASEDIR/ngsolve-build
# - cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install ${BASEDIR}/ngsolve-src
# - make -j4
# - ls
# - ls $BASEDIR
# - cd
# - pwd
# # - echo "export NETGENDIR=${BASEDIR}/ngsolve-install/bin" >> ~/.bashrc
# # - echo "export PATH=\$NETGENDIR:\$PATH" >> ~/.bashrc
# # - export PYTHONPATH_TMP=`python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1,0,''))"`
# # - echo "export PYTHONPATH=\$NETGENDIR/../${PYTHONPATH_TMP}:\$PATH" >> ~/.bashrc
# # - source ~/.bashrc
# artifacts:
# untracked: true
# when: on_success
# expire_in: "30 days"
# paths:
# - /builds/valentin.hanser/ngmultiscale/ngsuite/ngsolve-install
# - /builds/valentin.hanser/ngmultiscale/ngsuite/ngsolve-src
# cache:
# - key: cache-ngsolve
# paths:
# # - /builds/valentin.hanser/ngmultiscale/ngsuite/*
# build-cempy-job:
# stage: build
# image: python:3.10
# needs:
# - "build-ngsolve-job"
# dependencies:
# - "build-ngsolve-job"
# before_script:
# - apt-get update -q -y
# - apt-get install -y python3-pip
# - python -V
# - apt-get install -y cmake
# - echo "Compiling the code for cempy..."
# - cd C++/cmake
# - mkdir build
# - cd build
# - cmake .. -DOPTION_BIOTSAVART=OFF -DOPTION_BSPLINEINTERFACESPACE=OFF -DOPTION_PREISACH_SCALAR=OFF -DOPTION_PREISACH_VECTOR=OFF -DOPTION_ENERGYBASEDMODEL=OFF -DOPTION_MARKUSLIB=OFF -DOPTION_MULTISCALE=OFF -DOPTION_MUNONLINBIRO=OFF -DOPTION_NONLINEAR=OFF -DOPTION_PHIFUNCTIONS=OFF
# - make -j4
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# - cd
# - export PYTHONPATH=~/C++/cmake/build
# - python3 -c "from ngsolve import *;import cempy as cp"
# cache:
# - key: cache-cempy
# paths:
# - /builds/valentin.hanser/ngmultiscale/C++/cmake/build/*
# artifacts:
# untracked: true
# when: on_success
# expire_in: "30 days"
# paths:
# - /builds/valentin.hanser/ngmultiscale/ngsuite/*
# - /builds/valentin.hanser/ngmultiscale/C++/cmake/build/cempy.so
build-basicTypes-job: # This job runs in the build stage, which runs first.
stage: build
image: gcc
before_script:
- apt update && apt -y install make
script:
- echo "Compiling the code for basicTypes..."
- cd ./C++/basicTypes
- make unitTest
- echo "Compile basicTypes complete."
artifacts:
name: "$CI_JOB_ID"
when: on_success
expire_in: "1 days"
paths:
- ./C++/basicTypes/unitTest
- ./C++/basicTypes/*.o
build-unitTestEverett-job: # This job runs in the build stage, which runs first.
stage: build
image: gcc
before_script:
- apt update && apt -y install make
script:
- echo "Compiling the code for EverettMatrix..."
- cd ./C++/preisach/preisachScalar/
- make unitTestEverett -j3
- echo "Compile unitTestEverett complete."
artifacts:
name: "$CI_JOB_ID"
untracked: true
when: on_success
expire_in: "1 days"
paths:
- ./C++/preisach/preisachScalar/unitTestEverett
- ./C++/preisach/preisachScalar/*.o
build-unitTestPreisachScalar-job: # This job runs in the build stage, which runs first.
stage: build
image: gcc
before_script:
- apt update && apt -y install make
script:
- echo "Compiling the code for PreisachScalar..."
- cd ./C++/preisach/preisachScalar/
- make unitTest -j3
- echo "Compile unitTest complete."
artifacts:
name: "$CI_JOB_ID"
untracked: true
when: on_success
expire_in: "1 days"
paths:
- ./C++/preisach/preisachScalar/unitTest
- ./C++/preisach/preisachScalar/*.o
# ---------------------------------------------------------------
unit-test-basicTypes-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
image: gcc
dependencies:
- "build-basicTypes-job"
needs :
- "build-basicTypes-job"
script:
- echo "Running unit tests basicTypes."
- cd ./C++/basicTypes
- ./unitTest
unit-test-EverettUnitTest-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
image: gcc
dependencies:
- "build-unitTestEverett-job"
needs : ["build-unitTestEverett-job"]
script:
- echo "Running unit tests Everett Matrix."
- cd ./C++/preisach/preisachScalar
- ./unitTestEverett
unit-test-PreisachScalarUnitTest-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
image: gcc
dependencies:
- "build-unitTestPreisachScalar-job"
needs : ["build-unitTestPreisachScalar-job"]
script:
- echo "Running unit tests PreisachScalar."
- cd ./C++/preisach/preisachScalar
- ./unitTest
unit-test-python3-MS_helper_function:
stage: test # It only starts when the job in the build stage completes successfully.
image: python:3.10
needs: []
before_script:
- apt-get update -q -y
- apt-get install -y python3-pip
- python -V
- pip3 install ngsolve
- pip3 install numpy
- pip3 install matplotlib
- pip3 install sympy
- export PYTHONPATH=/builds/valentin.hanser/ngmultiscale/python:/builds/valentin.hanser/ngmultiscale/python/MeshGenerators
# - echo $PYTHONPATH
script:
- echo "Running python3 unit tests MS_helper_function."
- cd unitTests
- echo $PYTHONPATH
- python3 unitTest_MS_helper_Functions.py
- pip install -U sphinx
- python3 -m pip install nbsphinx --user
- pip install sphinx sphinx_rtd_theme
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH