-
Notifications
You must be signed in to change notification settings - Fork 23
144 lines (121 loc) · 5.87 KB
/
unit_tests.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build and unit tests
on:
# Triggers the workflow on push or pull request events but only for the main branch
# Remove push when finally merging.
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
# This job is called test_docs.
unit_test_and_docs:
# Run on Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: TMR Build/Test
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install and run unit tests
run: |
echo "=============================================================";
echo "Run #${GITHUB_RUN_NUMBER}";
echo "Run ID: ${GITHUB_RUN_ID}";
echo "Testing: ${GITHUB_REPOSITORY}";
echo "Triggered by: ${GITHUB_EVENT_NAME}";
echo "Initiated by: ${GITHUB_ACTOR}";
echo "=============================================================";
echo "=============================================================";
echo "Create conda environment";
echo "=============================================================";
source $CONDA/etc/profile.d/conda.sh;
echo $CONDA/bin >> $GITHUB_PATH;
conda create -n TMR python=3.8 numpy scipy -q -y;
conda activate TMR;
echo "=============================================================";
echo "Installing dependencies";
echo "=============================================================";
# Set directory variables
export TMR_DIR=${GITHUB_WORKSPACE};
# zlib 1.2.12 apparently breaks this install, so we pin an older version
conda install zlib=1.2.11;
conda install -c anaconda openmpi -q -y;
conda install gxx_linux-64=9.3.0 -q -y;
conda install -c anaconda openblas -q -y;
conda install -c conda-forge lapack -q -y;
conda install -c conda-forge metis -q -y;
# Install packages via pip
pip install testflo;
pip install cython;
# Install libraries via apt-get
sudo apt-get install libglu1-mesa
# Install Blossom V
cd $TMR_DIR/extern;
wget https://pub.ist.ac.at/~vnk/software/blossom5-v2.05.src.tar.gz;
tar -zxf blossom5-v2.05.src.tar.gz;
cd blossom5-v2.05.src;
cp ../Makefile-blossom5 Makefile;
make;
make lib;
# Install OpenCASCADE
cd $TMR_DIR/extern;
wget https://acdl.mit.edu/ESP/otherOCCs/OCC681lin64.tgz;
tar -zxf OCC681lin64.tgz;
mv OpenCASCADE-6.8.1/ OpenCASCADE;
export CASROOT=$TMR_DIR/extern/OpenCASCADE;
export CASARCH=;
export PATH=$CASROOT/bin:$PATH;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CASROOT/lib;
# Install egads4py
cd $TMR_DIR/extern;
git clone https://github.com/smdogroup/egads4py.git;
cd egads4py;
rm -rf tests;
rm -rf examples;
cp Makefile.in.info Makefile.in;
make EGADS_DIR=$TMR_DIR/extern/egads4py OPENCASCADE_INCLUDE=-I$CASROOT/$CASARCH/inc;
make interface;
export PYTHONPATH=${PYTHONPATH}:${TMR_DIR}/extern/egads4py;
# Install tacs
cd $TMR_DIR/extern;
git clone https://github.com/smdogroup/tacs.git;
cd tacs;
rm -rf tests;
rm -rf examples;
cp Makefile.in.info Makefile.in;
make OPENCASCADE_INCLUDE=-I$CASROOT/$CASARCH/inc TACS_DIR=$TMR_DIR/extern/tacs METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
make interface TACS_DIR=$TMR_DIR/extern/tacs METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
export PYTHONPATH=${PYTHONPATH}:${TMR_DIR}/extern/tacs;
# Install paropt
cd $TMR_DIR/extern;
git clone https://github.com/smdogroup/paropt.git;
cd paropt;
rm -rf tests;
rm -rf examples;
cp Makefile.in.info Makefile.in;
make PAROPT_DIR=$TMR_DIR/extern/paropt METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
make interface PAROPT_DIR=$TMR_DIR/extern/paropt;
export PYTHONPATH=${PYTHONPATH}:${TMR_DIR}/extern/paropt;
# Copy over and modify Makefile.in
cd $TMR_DIR;
head -n -4 Makefile.in.info > Makefile.in;
sed -i 's/TMR_DEBUG_FLAGS = -fPIC -g/TMR_DEBUG_FLAGS = -fPIC -g -DTMR_HAS_OPENCASCADE -DTMR_HAS_EGADS/g' Makefile.in;
sed -i 's/TMR_FLAGS = -fPIC -O3/TMR_FLAGS = -fPIC -O3 -DTMR_HAS_OPENCASCADE -DTMR_HAS_EGADS/g' Makefile.in;
# Compile TMR
echo "=============================================================";
echo "Installing TMR";
echo "=============================================================";
cd $TMR_DIR;
make OPENCASCADE_INCLUDE=-I$CASROOT/$CASARCH/inc TMR_DIR=$TMR_DIR EGADS_DIR=$TMR_DIR/extern/egads4py TACS_DIR=$TMR_DIR/extern/tacs PAROPT_DIR=$TMR_DIR/extern/paropt METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
make interface OPENCASCADE_INCLUDE=-I$CASROOT/$CASARCH/inc TMR_DIR=$TMR_DIR EGADS_DIR=$TMR_DIR/extern/egads4py TACS_DIR=$TMR_DIR/extern/tacs PAROPT_DIR=$TMR_DIR/extern/paropt METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
echo "=============================================================";
echo "running tests";
echo "=============================================================";
rm -rf examples;
testflo .;