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
|
name: ci-test
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 3 * * 0'
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- macos-15
- windows-2025
mpi:
- mpich
- openmpi
- msmpi
py:
- "3.13"
- "3.13t"
- "3.14"
- "3.14t"
- "pypy-3.11"
exclude:
- os: ubuntu-24.04
mpi: msmpi
- os: macos-15
mpi: msmpi
- os: windows-2025
mpi: mpich
- os: windows-2025
mpi: openmpi
steps:
- uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Configure hostname
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: Checkout
uses: actions/checkout@v5
- name: Setup MPI (${{ matrix.mpi }})
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Setup Python (${{ matrix.py }})
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.py }}
allow-prereleases: true
check-latest: true
cache: pip
cache-dependency-path: |
conf/requirements-build-cython.txt
conf/requirements-test.txt
- name: Upgrade pip
run: python -m pip install -U pip
- name: Build package
run: python -m pip wheel -v --wheel-dir=dist .
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: mpi4py-${{ matrix.os }}-${{ matrix.mpi }}-${{ matrix.py }}
path: dist/mpi4py-*.whl
- name: Install package for testing
run: python -m pip install mpi4py
--verbose --no-index --find-links=dist
- name: Install Python packages (test)
run: python -m pip install -U -r conf/requirements-test.txt
if: ${{ !endsWith(matrix.py, '-dev') &&
!contains(matrix.py, '-alpha') }}
- name: Test mpi4py (np=1)
run: mpiexec -n 1 python test/main.py -v
- name: Test mpi4py (np=2)
run: mpiexec -n 2 python test/main.py -v -f -e spawn
- name: Test mpi4py.futures (np=1)
run: mpiexec -n 1 python demo/futures/test_futures.py -v
- name: Test mpi4py.futures (np=2)
run: mpiexec -n 2 python demo/futures/test_futures.py -v
- name: Test mpi4py.run
run: python demo/test-run/test_run.py -v
if: matrix.mpi != 'msmpi'
- name: Test init-fini
run: bash demo/init-fini/run.sh
if: matrix.mpi != 'msmpi'
- name: Test check-mpiexec
run: bash demo/check-mpiexec/run.sh
if: matrix.mpi != 'msmpi'
- name: Uninstall package after testing
run: python -m pip uninstall --yes mpi4py
|