-
Notifications
You must be signed in to change notification settings - Fork 25
204 lines (184 loc) · 7.3 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
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
name: Build, unit tests
on:
# Triggers the workflow on push or pull request events but only for the master 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:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
# This job is called test_docs.
unit_tests:
# Run on Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
# Necessary to prevent mpi tests failing due to lack of slots
env:
OMPI_MCA_btl: self,tcp
OMPI_MCA_rmaps_base_oversubscribe: 1
# Ensures conda environment is initialized for all steps
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
include:
# real versions
- NAME: Real
OPTIONAL: 'default'
INTERFACE: 'interface'
PUBLISH_DOCS: true
# complex versions
- NAME: Complex
OPTIONAL: 'complex'
INTERFACE: 'complex_interface'
PUBLISH_DOCS: false
# Recommended if you intend to make multiple deployments in quick succession
concurrency: ci-${{ github.ref }}-${{ matrix.NAME }}
name: FUNtoFEM ${{ matrix.NAME }} Build/Test
steps:
- name: Display run details
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 "=============================================================";
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- uses: actions/checkout@v2
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
- name: Install TACS
run: |
git clone https://github.com/smdogroup/tacs.git /home/runner/work/tacs;
export TACS_DIR=/home/runner/work/tacs;
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;
conda install -c conda-forge petsc=3.12 petsc4py -q -y;
pip install cython;
cd $TACS_DIR;
cp Makefile.in.info Makefile.in;
make ${{ matrix.OPTIONAL }} TACS_DIR=$TACS_DIR METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
cd $TACS_DIR;
make ${{ matrix.INTERFACE }};
- name: Install FUNtoFEM
run: |
echo "=============================================================";
echo "Install FUNtoFEM";
echo "=============================================================";
export F2F_DIR=${GITHUB_WORKSPACE};
echo "F2F_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
cd $F2F_DIR;
cp Makefile.in.info Makefile.in;
make ${{ matrix.OPTIONAL }} F2F_DIR=$F2F_DIR METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
cd $F2F_DIR;
make ${{ matrix.INTERFACE }};
- name : Install optional ESP/CAPS
if: ${{ matrix.NAME == 'Real' }}
run: |
echo "=============================================================";
echo "Install ESP/CAPS";
echo "=============================================================";
# Install ESP/CAPS prebuilt for shape derivatives, only in Real mode
cd $F2F_DIR;
mkdir extern
cd $F2F_DIR/extern/
wget https://acdl.mit.edu/ESP/PreBuilts/ESP123-linux-x86_64.tgz
tar -xvf ESP123-linux-x86_64.tgz
export ESP_ROOT=${F2F_DIR}/extern/ESP123/EngSketchPad
export CASROOT=${F2F_DIR}/extern/ESP123/OpenCASCADE-7.7.0
export CASARCH=
export PATH=$PATH:$CASROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CASROOT/lib
cd $ESP_ROOT
./config/makeEnv ${CASROOT}
source $ESP_ROOT/../ESPenv.sh
cd ./src/CAPS/aim
make
cd $F2F_DIR/extern/ESP123/
# remove all ESP/CAPS unit test files with recursive delete
find . -name "test*" -type f -delete
cd $F2F_DIR
- name: Run unit tests
run: |
echo "=============================================================";
echo "Running Tests";
echo "=============================================================";
if [[ ${{ matrix.NAME }} == 'Real' ]]; then
source ${F2F_DIR}/extern/ESP123/ESPenv.sh
fi
testflo ${GITHUB_WORKSPACE}/tests/unit_tests/;
make-docs:
# Recommended if you intend to make multiple deployments in quick succession
#concurrency: ci-${{ github.ref }}
# Run on Ubuntu
runs-on: ubuntu-latest
# Necessary to prevent mpi tests failing due to lack of slots
env:
OMPI_MCA_btl: self,tcp
OMPI_MCA_rmaps_base_oversubscribe: 1
# Ensures conda environment is initialized for all steps
defaults:
run:
shell: bash -l {0}
steps:
- name: Display run details
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 "=============================================================";
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- uses: actions/checkout@v2
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
- name: Install FUNtoFEM
run: |
echo "=============================================================";
echo "Install FUNtoFEM";
echo "=============================================================";
export F2F_DIR=${GITHUB_WORKSPACE};
echo "F2F_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
cd $F2F_DIR;
cp Makefile.in.info Makefile.in;
conda install sphinx -q -y;
- name: Build docs
run: |
cd ${GITHUB_WORKSPACE}/docs;
make html BUILDDIR=.;
cd html;
zip -r ../f2f-docs.zip .;
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: f2f-docs
path: docs/f2f-docs.zip
- name: Deploy docs
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to
folder: docs/html/ # The folder the action should deploy