-
Notifications
You must be signed in to change notification settings - Fork 118
186 lines (171 loc) · 7.62 KB
/
oas.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
name: OAS build
# This workflow runs all unit and regression tests, as well as coveralls.
# On the pull-request events, this workflow runs OAS tests, checks code format by flake8/black, and builds the docs.
# On the push-to-main events, it also deploys the docs.
on:
pull_request:
push:
branches:
- main
tags:
- v*.*.*
schedule:
# Run the tests at 7:23pm UTC on the 2nd and 17th of every month
- cron: '23 19 2,17 * *'
jobs:
# --- run OAS unit and regression tests ---
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false # continue other jobs even if one of the jobs in matrix fails
matrix:
dep-versions: ["oldest", "latest"]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PYTHON_VERSION_OLDEST: ['3.8']
PYTHON_VERSION_LATEST: ['3.11']
PIP_VERSION_OLDEST: ['23.3.2'] # OpenMDAO 3.15 doesn't install with pip>=24
WHEEL_VERSION_OLDEST: ['0.38.4'] # latest wheel cannot build the oldest OpenMDAO (3.17 or older)
NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI
SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI
OPENMDAO_VERSION_OLDEST: ['3.15'] # latest is most recent on PyPI
MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI
PYGEO_VERSION_OLDEST: ['1.6.0'] # latest is pulled from main branch, for some reason anything after 1.12.2 seg faults on the old build
VSP_VERSION: ['3.27.1'] # used for both builds
PETSC_VERSION_LATEST: ['3.19.1']
CYTHON_VERSION: ['0.29.36'] # used for both builds
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.PYTHON_VERSION_OLDEST }}
if: ${{ matrix.dep-versions == 'oldest' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION_OLDEST }}
- name: Set up Python ${{ matrix.PYTHON_VERSION_LATEST }}
if: ${{ matrix.dep-versions == 'latest' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION_LATEST }}
# we need OpenVSP to run vsp tests.
- name: Install OpenVSP
run: |
sudo apt-get update
export PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
export PYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
export INST_PREFIX=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('prefix'))")
cd ..
sudo apt-get install cmake libx11-dev libfltk1.3-dev libcpptest-dev libglm-dev libeigen3-dev libcminpack-dev \
libglew-dev doxygen graphviz texlive-latex-base
mkdir OpenVSP
cd OpenVSP
mkdir build buildlibs
# Download source code
wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz
tar -xf OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz
mv OpenVSP-OpenVSP_${{ matrix.VSP_VERSION }} repo
# Build dependency libs
cd buildlibs
cmake -DVSP_USE_SYSTEM_LIBXML2=true -DVSP_USE_SYSTEM_FLTK=true -DVSP_USE_SYSTEM_GLM=true \
-DVSP_USE_SYSTEM_GLEW=true -DVSP_USE_SYSTEM_CMINPACK=true -DVSP_USE_SYSTEM_LIBIGES=false \
-DVSP_USE_SYSTEM_EIGEN=false -DVSP_USE_SYSTEM_CODEELI=false -DVSP_USE_SYSTEM_CPPTEST=false \
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} ../repo/Libraries -DCMAKE_BUILD_TYPE=Release
make -j8
# Build OpenVSP
cd ..
export BUILD_LIBS_PATH=`pwd`
cd build
cmake ../repo/src/ -DVSP_NO_GRAPHICS=true -DVSP_LIBRARY_PATH=${BUILD_LIBS_PATH}/buildlibs \
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
-DCMAKE_BUILD_TYPE=Release
make -j8
make package
# Install python interface
pushd _CPack_Packages/Linux/ZIP/OpenVSP-${{ matrix.VSP_VERSION }}-Linux/python
pip install -r requirements.txt
pushd ..
cp vspaero vspscript vspslicer $INST_PREFIX/bin
popd
popd
# OAS dependencies are specified in setup.py.
- name: Install OAS and its dependencies (oldest versions)
if: ${{ matrix.dep-versions == 'oldest' }}
run: |
python -m pip install pip==${{ matrix.PIP_VERSION_OLDEST }}
python -m pip install wheel==${{ matrix.WHEEL_VERSION_OLDEST }}
pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }}
pip install -e .[test]
- name: Install OAS and its dependencies (latest versions)
if: ${{ matrix.dep-versions == 'latest' }}
run: |
python -m pip install --upgrade pip wheel
pip install -e .[test,mphys]
- name: Install MPI
run: |
sudo apt-get install openmpi-bin libopenmpi-dev
pip install mpi4py
# install PETSc on the latest for MPI tests
- name: Install PETSc
if: ${{ matrix.dep-versions == 'latest' }}
run: |
cd ..
pip download petsc==${{ matrix.PETSC_VERSION_LATEST }}
tar -xf petsc-${{ matrix.PETSC_VERSION_LATEST }}.tar.gz
cd petsc-${{ matrix.PETSC_VERSION_LATEST }}
export PETSC_ARCH=real-debug
export PETSC_DIR=`pwd`
./configure --PETSC_ARCH=$PETSC_ARCH --download-fblaslapack
make PETSC_DIR=$PETSC_DIR PETSC_ARCH=$PETSC_ARCH all
# Cython 3.0.0 break petsc4py install
pip install cython==${{ matrix.CYTHON_VERSION }}
pip install petsc4py==${{ matrix.PETSC_VERSION_LATEST }}
# We need pySpline/pyGeo to run FFD tests.
- name: Install pySpline
run: |
cd ..
git clone https://github.com/mdolab/pyspline.git
cd pyspline
cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk
make
pip install -e .
- name: Install pyGeo ${{ matrix.PYGEO_VERSION_OLDEST }}
if: ${{ matrix.dep-versions == 'oldest' }}
run: |
pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git@v${{ matrix.PYGEO_VERSION_OLDEST }}"
- name: Install pyGeo latest
if: ${{ matrix.dep-versions == 'latest' }}
run: |
pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git"
- name: List installed Python packages
run: |
pip list -v
- name: Run tests (latest)
env:
OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages
if: ${{ matrix.dep-versions == 'latest' }}
run: |
testflo -n 2 -v openaerostruct --coverage --coverpkg openaerostruct
coverage xml
# skip MPI tests on the oldest
- name: Run tests (oldest)
env:
OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages
if: ${{ matrix.dep-versions == 'oldest' }}
run: |
testflo -n 2 -v --exclude \*MPI\* openaerostruct --coverage --coverpkg openaerostruct
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# --- linting and formatting ---
black:
uses: mdolab/.github/.github/workflows/black.yaml@main
flake8:
uses: mdolab/.github/.github/workflows/flake8.yaml@main
# --- publish to PyPI
pypi:
needs: [test, flake8, black]
uses: mdolab/.github/.github/workflows/pypi.yaml@main
secrets: inherit