-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
123 lines (98 loc) · 4 KB
/
.gitlab-ci.yml
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
variables:
override_module_branch:
value: ""
description: "override the default branch for each Marmot module"
override_edelweiss_branch:
value: ""
description: "override the default branch for EdelweissFE"
# number of columns in the module definition matrix
marmot_module_defintion_matrix_col_size: 3
# core libraries
CoreModules:
# repo name secret repo url default branch
value: |
MarmotMechanicsCore $MarmotMechanicsCore_Repo master
MarmotFiniteElementCore $MarmotFiniteElementCore_Repo master
MarmotMathCore $MarmotMathCore_Repo master
# element libraries
ElementModules:
# repo name secret repo url default branch
value: |
DisplacementFiniteElement $DisplacementFiniteElement_Repo master
# material libraries
MaterialModules:
# repo name secret repo url default branch
value: |
LinearElastic $LinearElastic_Repo master
B4 $B4_Repo master
VonMises $VonMises_Repo master
format:
stage: test
image: condaforge/mambaforge:23.11.0-0
needs: []
script:
- mamba install -c conda-forge clang-format-16
- find . \( -name \*.cpp -o -name \*.h \) -print0 | xargs -0 -n 1 clang-format-16 --Werror -n --verbose
only:
- merge_requests
build and test:
stage: build
image: condaforge/mambaforge:23.11.0-0
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; }
- git clone $EdelweissFE_Repo
- mamba install -c anaconda --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 -DINCLUDE_INSTALL_DIR=$(python -c "import sys; print(sys.prefix)")/include -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 -DAUTODIFF_BUILD_TESTS=OFF -DAUTODIFF_BUILD_PYTHON=OFF -DAUTODIFF_BUILD_EXAMPLES=OFF -DAUTODIFF_BUILD_DOCS=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 ../
- cd EdelweissFE
- if [ ! -z "$override_edelweiss_branch" ]; then
echo "trying to check out branch $override_edelweiss_branch" ;
git checkout $override_edelweiss_branch || echo "branch $module_branch not available for EdelweissFE" ;
fi;
- pip install .
- run_tests_edelweissfe ./testfiles