Merge pull request #392 from deepanshs/rc1.0 #2221
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master, 'v?.?*'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code_lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=B,C,E,F,W,T,N8 --ignore=E402 --max-line-length=88 --show-source --statistics --exclude="examples/* *.npy docs/* *.pyx *.pxd" | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=8 --max-line-length=88 --statistics --exclude="examples/* *.npy docs/* *.pyx *.pxd" | |
testing_unix: | |
needs: [code_lint] | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install linux system dependencies | |
run: | | |
sudo apt-get install --yes libopenblas-dev libfftw3-dev | |
gcc -v | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install -r requirements-dev.txt | |
- name: Build and install package from source | |
run: python setup.py develop | |
- name: Test with pytest | |
run: | | |
python -m pip install pytest -U | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
testing_mac_arm: | |
needs: [code_lint] | |
runs-on: "macos-latest" | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install macos system dependencies | |
run: brew install openblas fftw | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install -r requirements-dev.txt | |
- name: Build and install package from source | |
run: python setup.py develop | |
- name: Test with pytest | |
run: | | |
python -m pip install pytest -U | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
testing_mac_intel: | |
needs: [code_lint] | |
runs-on: "macos-13" | |
strategy: | |
matrix: | |
python-version: ["3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install macos system dependencies | |
run: brew install openblas fftw | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install -r requirements-dev.txt | |
- name: Build and install package from source | |
run: python setup.py develop | |
- name: Test with pytest | |
run: | | |
python -m pip install pytest -U | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/[email protected] | |
testing_windows: | |
needs: [code_lint] | |
runs-on: "windows-latest" | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" | |
with: | |
auto-update-conda: true | |
auto-activate-base: false | |
miniconda-version: "latest" | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment-dev.yml | |
activate-environment: mrsimulator-dev | |
- run: | | |
conda --version | |
which python | |
- name: Build and install package from source | |
shell: pwsh | |
run: | | |
conda --version | |
which python | |
python setup.py develop | |
- name: Test with pytest | |
shell: pwsh | |
run: | | |
python -m pip install pytest -U | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/[email protected] |