-
Notifications
You must be signed in to change notification settings - Fork 75
164 lines (154 loc) · 6.47 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
name: Build, unit tests, and docs
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:
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_test_and_docs:
# Run on Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 40
# 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: 'debug'
INTERFACE: 'interface'
PUBLISH_DOCS: true
# complex versions
- NAME: Complex
OPTIONAL: 'complex_debug'
INTERFACE: 'complex_interface'
PUBLISH_DOCS: false
name: TACS ${{ matrix.NAME }} Build/Test/Docs
# Recommended if you intend to make multiple deployments in quick succession.
# This will kill any currently running CI from previous commits to the same branch
concurrency:
group: ci-${{ github.ref }}-${{ matrix.NAME }}
cancel-in-progress: true
steps:
- name: Display run details
run: |
echo "=============================================================";
echo "Run #${GITHUB_RUN_NUMBER}";
echo "Run ID: ${GITHUB_RUN_ID}";
lscpu;
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 miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
- name: Install TACS
run: |
export TACS_DIR=${GITHUB_WORKSPACE};
echo "TACS_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
conda install -c conda-forge sysroot_linux-64=2.17 -q -y;
conda install -c conda-forge openmpi openmpi-mpicxx -q -y;
conda install -c anaconda openblas -q -y;
conda install -c conda-forge lapack -q -y;
conda install -c conda-forge metis=5.1.0 -q -y;
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 }};
cd $TACS_DIR/examples;
make ${{ matrix.OPTIONAL }} TACS_DIR=$TACS_DIR METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
- name: Install f5totec/f5tovtk
run: |
# Compile f5totec/f5tovtk
conda install -c smdogroup tecio -q -y;
cd $TACS_DIR/extern/f5totec;
make TACS_DIR=$TACS_DIR TECIO_INCLUDE=-I${CONDA_PREFIX}/include/ TECIO_LIB=${CONDA_PREFIX}/lib/libtecio.a\
METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
cd ..;
cd f5tovtk;
make TACS_DIR=$TACS_DIR METIS_INCLUDE=-I${CONDA_PREFIX}/include/ METIS_LIB="-L${CONDA_PREFIX}/lib/ -lmetis";
- name: Install optional dependencies
run: |
# Install petsc for openmdao tests
conda install -c conda-forge petsc=3.19 petsc4py -q -y;
# Install ESP/CAPS prebuilt for shape derivatives, only in Real mode
if [[ ${{ matrix.NAME }} == 'Real' ]]; then
cd $TACS_DIR/extern/
wget https://acdl.mit.edu/ESP/archive/ESP122Lin.tgz
tar -xvf ESP122Lin.tgz
export ESP_ROOT=${TACS_DIR}/extern/ESP122/EngSketchPad
export CASROOT=${TACS_DIR}/extern/ESP122/OpenCASCADE-7.6.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 $TACS_DIR/extern/ESP122/
# remove all ESP/CAPS unit test files with recursive delete
find . -name "test*" -type f -delete
cd $TACS_DIR
fi
- name: Run unit tests
run: |
# Reload ESP/CAPS environment variables if in real mode
if [[ ${{ matrix.NAME }} == 'Real' ]]; then
source ${TACS_DIR}/extern/ESP122/ESPenv.sh
fi
testflo --timeout 240 .;
- name: Build docs
run: |
cd $TACS_DIR/docs;
make html BUILDDIR=.;
cd html;
zip -r ../tacs-docs.zip .;
- name: 'Upload docs'
if: ${{ matrix.PUBLISH_DOCS }}
uses: actions/upload-artifact@v2
with:
name: tacs-docs
path: docs/tacs-docs.zip
retention-days: 7
- name: 'Deploy docs'
if: ${{ github.event_name == 'push' && matrix.PUBLISH_DOCS }}
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/html/ # The folder the action should deploy.
# This allows the user to ssh into the github runner and debug a job upon failure
# This will only trigger if the job was run using workflow_dispatch and debug_enabled input flag was set to true
- name: Setup interactive debug session on failure
if: ${{ failure() && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
# To access the terminal through the web-interface:
# 1. Click on the web-browser link printed out in this action from the github workkflow terminal
# 2. Press cntrl + c in the new tab that opens up to reveal the terminal
# 3. To activate the conda environment used to build TACS run:
# $ source $CONDA/etc/profile.d/conda.sh
# $ conda activate test