ci: start testing on 3.12 & 3.13 #228
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: CI | |
on: | |
[push, pull_request, workflow_dispatch] | |
jobs: | |
linting-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: 'pip' | |
cache-dependency-path: '**/setup.cfg' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade setuptools | |
pip --version | |
- name: Install package | |
run: | | |
pip install .[dev] | |
- name: Run checks | |
run: | | |
isort --verbose --check-only --diff src tests | |
flake8 src tests | |
# pylint src tests | |
docs-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: 'pip' | |
cache-dependency-path: | | |
setup.cfg | |
docs/conf.py | |
- name: Install dependencies | |
run: | | |
sudo apt-get install pandoc | |
python -m pip install --upgrade setuptools | |
pip --version | |
- name: Install package | |
run: | | |
pip install -e .[docs] | |
- name: Test build docs | |
run: | | |
sphinx-build -E -j auto -b doctest docs dist/docs | |
sphinx-build -E -j auto -b html docs dist/docs | |
sphinx-build -j auto -b linkcheck docs dist/docs | |
unit-tests: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version : ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
exclude: | |
- os: macos-latest | |
python-version: '3.7' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
python-version: ${{ matrix.python-version }} | |
activate-environment: test | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade setuptools | |
# Without this there's an odd error | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
conda install numpy pandas scipy matplotlib | |
fi | |
conda info | |
conda env list | |
pip --version | |
- name: Install package | |
run: | | |
pip install -e .[dev] | |
conda list | |
- name: Run tests | |
run: | | |
pytest --cov --cov-report=term-missing -vv | |
- name: Report coverage | |
run: | | |
# coverage report xml html --ignore-errors | |
codecov | |
build-publish: | |
runs-on: ubuntu-latest | |
needs: [linting-checks, docs-build, unit-tests] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install build | |
python -m pip install --upgrade setuptools wheel | |
pip --version | |
- name: Build wheels | |
run: python -m build | |
- name: Publish 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
verbose: true | |
- name: Publish 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: GH 🐱🐙 Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |