Skip to content

ci: Remove node 16 warnings in GHA #169

ci: Remove node 16 warnings in GHA

ci: Remove node 16 warnings in GHA #169

Workflow file for this run

name: Python package
on:
workflow_dispatch:
push:
branches: ["main", "quarto**"]
pull_request:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: |
pip install -e ".[dev,test]"
- name: Install
run: |
make install
- name: Run unit tests
run: |
make test
- name: pyright, flake8, black and isort
run: |
make check
docs:
permissions:
contents: write
name: "Build Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: |
# Install latest quartodoc from GitHub
pip install -e ".[dev,test,docs]"
- name: Install
run: |
make install
- name: Render quarto site
run: |
make docs-ci
- name: Publish to GitHub Pages (on push)
if: github.event_name == 'push'
uses: quarto-dev/quarto-actions/publish@v2
with:
path: docs
render: false
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: "Deploy to PyPI"
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [build]
steps:
- uses: actions/checkout@v4
- name: "Set up Python 3.11"
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,docs]"
- name: "Build Package"
run: |
make dist
# test deploy ----
- name: "Test Deploy to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.event.release.name, 'TEST')
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
## prod deploy ----
- name: "Deploy to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !startsWith(github.event.release.name, 'TEST') }}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}