Skip to content

fix a couple bugs with supersonic panel case #455

fix a couple bugs with supersonic panel case

fix a couple bugs with supersonic panel case #455

name: 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: [ main ]
pull_request:
branches: [ main ]
# 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
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.12"
- name: Install, run unit test, build docs
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 OpenMDAO -c conda-forge python=3.12 mamba=2.0.5 -q -y;
conda activate OpenMDAO;
pip install --upgrade pip;
conda install -c conda-forge numpy=2.2 scipy=1.15 lapack -q -y;
echo "=============================================================";
echo "Install PETSc";
echo "=============================================================";
mamba install -c conda-forge mpi4py petsc4py=3.21 -q -y;
echo "=============================================================";
echo "Install OpenMDAO";
echo "=============================================================";
cd ..;
pip install testflo;
pip install redbaron;
git clone -q https://github.com/OpenMDAO/OpenMDAO.git;
cd OpenMDAO;
pip install .[all];
cd ../mphys;
pip install -e .[all];
echo "=============================================================";
echo "Install optional dependencies";
echo "=============================================================";
mamba install -c "smdogroup/label/complex" -c smdogroup -c conda-forge "tacs>=3.8.0" "funtofem>=0.3.8" -q -y;
pip install openaerostruct;
echo "=============================================================";
echo "List installed packages/versions";
echo "=============================================================";
conda list;
echo "============================================================="
echo "Check MPI and PETSc installation"
echo "============================================================="
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
export OMPI_MCA_rmaps_base_oversubscribe=1
export OMPI_MCA_btl=^openib
echo "-----------------------"
echo "Quick test of mpi4py:"
mpirun -n 3 python -c "from mpi4py import MPI; print(f'Rank: {MPI.COMM_WORLD.rank}')"
echo "-----------------------"
echo "Quick test of petsc4py:"
mpirun -n 3 python -c "import numpy; from mpi4py import MPI; comm = MPI.COMM_WORLD; \
import petsc4py; petsc4py.init(); \
x = petsc4py.PETSc.Vec().createWithArray(numpy.ones(5)*comm.rank, comm=comm); \
print(x.getArray())"
echo "-----------------------"
echo "Quick test of numpy:"
python -c "import numpy as np; print(np.array([1,1,1]))"
echo "-----------------------"
echo "=============================================================";
echo "Running unit tests";
echo "=============================================================";
cd tests/unit_tests
testflo
echo "=============================================================";
echo "Running integration tests";
echo "=============================================================";
cd ../input_files
chmod +x get-input-files.sh
./get-input-files.sh
cd ../integration_tests
testflo test_tacs_* test_meld_* test_oas_*
echo "=============================================================";
echo "Making docs";
echo "=============================================================";
cd ../../docs
make html