diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 220c2909e..11e933c29 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -16,158 +16,31 @@ on: - 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 + fail-fast: false matrix: - dep-versions: ["oldest", "latest"] - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - PYTHON_VERSION_OLDEST: ['3.9'] - PYTHON_VERSION_LATEST: ['3.11'] - NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI - SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI - OPENMDAO_VERSION_OLDEST: ['3.22'] # 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 + dockerImage: [stable, latest] + runs-on: ubuntu-latest + container: mdolab/public:u22-gcc-ompi-${{ matrix.dockerImage }}-amd64 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: | - 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 }} + - uses: actions/checkout@v4 + - name: Install OAS + run: | + pip install -e .[test,mphys] + - name: Run tests (latest) + run: | + testflo -n 2 -v 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: