Adapt to level config to match other Jupyter repos #223
Workflow file for this run
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: | |
push: | |
branches: ["main"] | |
pull_request: | |
schedule: | |
- cron: "0 8 * * *" | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- uses: pre-commit/[email protected] | |
tests: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", " 3.12"] | |
os: [ubuntu-latest] | |
include: | |
- os: windows-latest | |
python-version: "3.12" | |
- os: macos-latest | |
python-version: "3.12" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip hatch | |
- name: Run tests | |
run: hatch run test:test -x | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip hatch | |
- name: Build docs | |
run: | | |
hatch run doc:build | |
publish: | |
name: Publish to PyPi | |
needs: [tests] | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Build package | |
run: | | |
pip install wheel | |
python setup.py sdist bdist_wheel | |
- name: Publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_KEY }} |