modified examples #489
This file contains 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: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
backend: [numpy, jax] | |
env: | |
OMPI_MCA_rmaps_base_oversubscribe: "1" | |
OMPI_MCA_mpi_yield_when_idle: "1" | |
ROGER_REQUIRE_CYTHON_EXT: "0" | |
steps: | |
- uses: actions/checkout@v4 | |
# make sure tags are fetched so we can get a version | |
- run: git fetch --prune --unshallow --tags | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore pip cache | |
uses: actions/cache@v4 | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ matrix.os }}-pip- | |
- name: Setup Python environment | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install cython | |
- name: Install system requirements | |
run: | | |
sudo apt-get update | |
sudo apt-get install libopenmpi-dev | |
- name: Install Roger | |
run: | | |
pip install mpi4py | |
if [ ${{ matrix.backend }} == "jax" ] | |
then | |
pip install mpi4jax | |
pip install -e .[test,jax] | |
else | |
pip install -e .[test] | |
fi | |
- name: Run tests | |
run: | | |
pytest . -v --cov --backend ${{ matrix.backend }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 |