Skip to content

Merge pull request #267 from nonhermitian/update-workflow #971

Merge pull request #267 from nonhermitian/update-workflow

Merge pull request #267 from nonhermitian/update-workflow #971

name: Testing
on:
push:
branches: [main]
pull_request:
branches: []
jobs:
conda-test:
name: ${{ matrix.os }} using Py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
conda info
pip install -U -r requirements.txt -c constraints.txt
- name: Black
run: |
pip install -U -r requirements-dev.txt -c constraints.txt
if [ "$RUNNER_OS" == "Linux" ]; then
MTHREE_OPENMP=1 python setup.py build_ext --inplace
else
python setup.py build_ext --inplace
fi
black --check mthree
- name: Run tests with pytest
run: |
pip install pytest
if [ "$RUNNER_OS" == "Linux" ]; then
MTHREE_OPENMP=1 pip install .
else
pip install .
fi
pytest -p no:warnings --pyargs mthree/test
- name: Build docs
run: |
conda install pandoc
cd docs
make html