Windows support (#24) #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '1 5 * * 1' | |
# Cancel running jobs if new commits are pushed | |
concurrency: | |
group: > | |
${{ github.workflow }}- | |
${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
mpi: [mpich, openmpi, msmpi] | |
exclude: | |
- os: ubuntu-latest | |
mpi: msmpi | |
- os: macos-latest | |
mpi: msmpi | |
- os: windows-latest | |
mpi: mpich | |
- os: windows-latest | |
mpi: openmpi | |
include: | |
- mpi: mpich | |
mpiexec: mpiexec | |
- mpi: openmpi | |
mpiexec: mpiexec --oversubscribe | |
- mpi: msmpi | |
mpiexec: mpiexec | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
# Micromamba needs a login shell to make sure the environment is active | |
shell: bash -el {0} | |
env: | |
PYTEST_MPI_MAX_NPROCS: 3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ".github/etc/test_environment_${{ matrix.mpi }}.yml" | |
create-args: >- | |
python=${{ matrix.python }} | |
- name: Install mpi-pytest | |
run: pip install --no-deps -e . | |
- name: Run tests | |
run: | | |
: # 'forking' mode | |
pytest -v tests | |
: # 'non-forking' mode | |
${{ matrix.mpiexec }} -n 1 pytest -v -m "not parallel or parallel[1]" tests | |
${{ matrix.mpiexec }} -n 2 pytest -v -m parallel[2] tests | |
${{ matrix.mpiexec }} -n 3 pytest -v -m parallel[3] tests |