Skip to content

Merge pull request #47 from swryan/om331 #9

Merge pull request #47 from swryan/om331

Merge pull request #47 from swryan/om331 #9

# Run CADRE Tests
name: CADRE Tests
on:
# Trigger on push or pull request events for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allow running the workflow manually from the Actions tab
workflow_dispatch:
jobs:
CADRE_tests:
runs-on: ubuntu-latest
timeout-minutes: 120
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 "============================================================="
- name: Checkout code
uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
conda-version: "*"
channels: conda-forge,defaults
channel-priority: true
- name: Create Environment
run: |
conda install numpy=1.23 scipy -q -y
python -m pip install --upgrade pip
python -m pip install six parameterized
python -m pip install openmdao[test]
python -m pip install .
pip install git+https://github.com/OpenMDAO/MBI
- name: Install PETSc
run: |
conda install mpi4py petsc4py -q -y
echo "============================================================="
echo "Check MPI and PETSc installation"
echo "============================================================="
export OMPI_MCA_rmaps_base_oversubscribe=1
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 "OMPI_MCA_rmaps_base_oversubscribe=1" >> $GITHUB_ENV
echo "Workaround for intermittent failures with OMPI https://github.com/open-mpi/ompi/issues/7393"
echo "TMPDIR=/tmp" >> $GITHUB_ENV
- name: Display environment info
run: |
conda info
conda list
- name: Run tests
run: |
echo "============================================================="
echo "Run tests (from directory other than repo root)"
echo "============================================================="
cd $HOME
testflo -n 1 CADRE --timeout=120 --show_skipped --coverage --coverpkg CADRE
- name: Submit coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: "github"
COVERALLS_PARALLEL: true
run: |
echo "============================================================="
echo "Submit coverage"
echo "============================================================="
cd $HOME
python -m pip install coveralls
SITE_DIR=`python -c 'import site; print(site.getsitepackages()[-1])'`
coveralls --basedir $SITE_DIR
coveralls:
name: Finish coverage
needs: [CADRE_tests]
runs-on: ubuntu-latest
steps:
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true