Skip to content

continuous-integration #290

continuous-integration

continuous-integration #290

name: continuous-integration
on:
schedule:
- cron: '0 3 * * 0'
push:
branches:
- main
- io
pull_request:
branches:
- main
- io
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
mpi:
- mpich
- openmpi
py:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- os: macos-latest
py: "3.8"
steps:
- name: Configure hostname
if: runner.os == 'Linux' || runner.os == 'macOS'
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
- name: Checkout
uses: actions/checkout@v4
- name: Setup MPI (${{ matrix.mpi }})
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Use Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
architecture: ${{ startsWith(matrix.os, 'macos-') && 'arm64' || 'x64' }}
- name: Install
run: python -m pip install .[mpi,test,ai] pytest-cov
- name: Test mpiexec_pod
run: mpiexec -n 2 python -m coverage run tests/test_pod_parallel.py
- name: Test mpiexec_spod
run: mpiexec -n 2 python -m coverage run tests/test_spod_parallel.py
- name: Test mpiexec_utils
run: mpiexec -n 2 python -m coverage run tests/test_utils_parallel.py
- name: Coverage combine
run: coverage combine
- name: Coverage report
run: coverage report
- name: Pytest --with-mpi
run: python -m pytest --cov=pyspod --cov-report=xml tests/ --with-mpi -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
test-no-mpi:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
py:
- "3.11"
- "3.12"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
architecture: ${{ startsWith(matrix.os, 'macos-') && 'arm64' || 'x64' }}
- name: Install
run: python -m pip install .[test,ai]
- name: Test package
run: python -m pytest -v tests/