Skip to content

Improvements & general refactoring #385

Improvements & general refactoring

Improvements & general refactoring #385

Workflow file for this run

name: Test and Deploy
on:
pull_request:
push:
env:
FORCE_COLOR: "1"
jobs:
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip
cache-dependency-path: |
.github/workflows/workflow.yml
dev-requirements.txt
- name: Install dependencies
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip
python -m pip install -r dev-requirements.txt
- name: Install package
run: |
python -m pip install .
- name: Build wheel
run: |
python -m pip install build
python -m build
- name: Upload sdist and wheel artifacts
uses: actions/upload-artifact@v4
with:
name: my-dist
path: dist/*
test:
needs: build-wheel
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- "pypy3.9"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
sphinx-version:
- ">=6,<7"
- ">=7,<8"
- ">=8,<9"
os:
- windows-latest
- macos-latest
- ubuntu-latest
exclude:
- python-version: "3.9"
sphinx-version: ">=8,<9"
- python-version: "pypy3.9"
sphinx-version: ">=6,<7"
os: "macos-latest"
- python-version: "pypy3.9"
sphinx-version: ">=7,<8"
os: "macos-latest"
- python-version: "pypy3.9"
sphinx-version: ">=8,<9"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
.github/workflows/workflow.yml
dev-requirements.txt
- name: Install dependencies
run: |
python -VV
python -m site
python -m pip install --upgrade pip
python -m pip install -r dev-requirements.txt
python -m pip install "sphinx${{ matrix.sphinx-version }}"
- name: Download sdist and wheel artifacts
uses: actions/download-artifact@v4
with:
name: my-dist
path: dist
- name: Install downloaded wheel
run: |
python -m pip install --only-binary=:all: --no-index --find-links=dist sphinxext-opengraph
- name: Run tests for ${{ matrix.python-version }}
run: |
python -m pytest -vv
- name: Install matplotlib
run: |
python -m pip install --only-binary :all: matplotlib
- name: Run tests with matplotlib for ${{ matrix.python-version }}
run: |
python -m pytest -vv
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3"
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
- name: Build documentation
run: |
cd docs
make html
pypi-release:
needs: test
runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags/') && github.repository_owner == 'wpilibsuite'
steps:
- name: Download sdist and wheel artifacts
uses: actions/download-artifact@v4
with:
name: my-dist
path: dist
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}