-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
193 lines (160 loc) · 5.5 KB
/
.gitlab-ci.yml
File metadata and controls
193 lines (160 loc) · 5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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
variables:
override_module_branch:
value: ""
description: "override the default branch for each Marmot module"
# number of columns in the module definition matrix
marmot_module_defintion_matrix_col_size: 3
# additional core libraries
# CoreModules:
# repo name secret repo url default branch
# value: |
# additional element libraries
# ElementModules:
# repo name secret repo url default branch
# value: |
# additional material libraries
MaterialModules:
# repo name secret repo url default branch
value: |
format:
stage: .pre
image: mambaorg/micromamba:latest
needs: []
rules:
- when: always
script:
- micromamba install pre-commit git
- git config --global --add safe.directory $CI_PROJECT_DIR
- pre-commit install
- pre-commit run --all
build:linux:
stage: build
image: debian:bookworm
rules:
- if: $CI_PIPELINE_SOURCE != 'merge_request_event'
script:
- function install_marmot_module(){
repo_name=$1;
repo_url=$2;
repo_default_branch=$3;
echo "installing module $repo_name with branch $repo_default_branch";
rm -rf $repo_name;
git clone --branch $repo_default_branch $repo_url $repo_name;
if [ ! -z "$override_module_branch" ]; then
echo "trying to check out branch $override_module_branch" ;
cd $repo_name;
git checkout $override_module_branch || echo "branch $module_branch not available for $repo_name" ;
cd ../ ;
fi; }
- function install_marmot_modules(){
modules=("$@");
for (( i=0; i<${#modules[@]}; i+=(($marmot_module_defintion_matrix_col_size)) ));
do
install_marmot_module ${modules[@]:$i:$marmot_module_defintion_matrix_col_size};
done; }
- apt-get update -y
- apt-get upgrade -y
- apt-get install -y wget cmake git libtbbmalloc2 build-essential gfortran
- git clone -b 3.4.0 https://gitlab.com/libeigen/eigen.git
- cd eigen
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF ..
- make install
- cd ../..
- git clone -b v1.1.0 https://github.com/autodiff/autodiff.git
- cd autodiff
- mkdir build
- cd build
- cmake -DAUTODIFF_BUILD_TESTS=OFF -DAUTODIFF_BUILD_PYTHON=OFF -DAUTODIFF_BUILD_EXAMPLES=OFF -DAUTODIFF_BUILD_DOCS=OFF ..
- make install
- cd ../..
- git clone https://github.com/romeric/Fastor.git
- cd Fastor
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF ..
- make install
- cd ../..
# - cd modules/core
# - install_marmot_modules ${CoreModules[@]}
# - cd ../..
# - cd modules/elements
# - install_marmot_modules ${ElementModules[@]}
# - cd ../..
- cd modules/materials
- install_marmot_modules ${MaterialModules[@]}
- cd ../..
- mkdir build
- cd build
- cmake ..
- make install
- ctest
build and test with edelweiss:
stage: test
image: mambaorg/micromamba:latest
only: [merge_requests]
script:
- function install_marmot_module(){
repo_name=$1;
repo_url=$2;
repo_default_branch=$3;
echo "installing module $repo_name with branch $repo_default_branch";
rm -rf $repo_name;
git clone --branch $repo_default_branch $repo_url $repo_name;
if [ ! -z "$override_module_branch" ]; then
echo "trying to check out branch $override_module_branch" ;
cd $repo_name;
git checkout $override_module_branch || echo "branch $module_branch not available for $repo_name" ;
cd ../ ;
fi; }
- function install_marmot_modules(){
modules=("$@");
for (( i=0; i<${#modules[@]}; i+=(($marmot_module_defintion_matrix_col_size)) ));
do
install_marmot_module ${modules[@]:$i:$marmot_module_defintion_matrix_col_size};
done; }
- micromamba install python=3.12
- micromamba install git
- git clone https://github.com/EdelweissFE/EdelweissFE.git
- micromamba install -c conda-forge --file EdelweissFE/requirements.txt
- git clone -b 3.4.0 https://gitlab.com/libeigen/eigen.git
- cd eigen
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") ..
- make install
- cd ../..
- git clone -b v1.1.0 https://github.com/autodiff/autodiff.git
- cd autodiff
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") -DAUTODIFF_BUILD_TESTS=OFF -DAUTODIFF_BUILD_PYTHON=OFF -DAUTODIFF_BUILD_EXAMPLES=OFF -DAUTODIFF_BUILD_DOCS=OFF ..
- make install
- cd ../..
- git clone https://github.com/romeric/Fastor.git
- cd Fastor
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") ..
- make install
- cd ../..
# - cd modules/core
# - install_marmot_modules ${CoreModules[@]}
# - cd ../..
# - cd modules/elements
# - install_marmot_modules ${ElementModules[@]}
# - cd ../..
- cd modules/materials
- install_marmot_modules ${MaterialModules[@]}
- cd ../..
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") ..
- make install
- ctest
- cd ..
# build and test EdelweissFE
- cd EdelweissFE
- python -m pip install .
- run_tests_edelweissfe testfiles/