Skip to content

.github/workflows/workflow.yaml #149

.github/workflows/workflow.yaml

.github/workflows/workflow.yaml #149

Workflow file for this run

on:
push:
schedule:
- cron: '0 3 * * 6'
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: 'Install Dependencies'
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: 'Lint'
run: tox
env:
TOXENV: 'lint'
docs:
name: "Build Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: 'Install Dependencies'
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: 'Build Docs'
run: tox
env:
TOXENV: 'docs'
test:
name: "Test"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
include:
- python-version: '3.10'
toxenv: py310
- python-version: '3.11'
toxenv: py311
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 'Install Dependencies'
run: |
python -m pip install --upgrade pip
python -m pip install tox wheel build
- name: 'Run Tests (with coverage)'
run: tox
env:
TOXENV: ${{ matrix.toxenv }}
- uses: codecov/codecov-action@v2
if: ${{ matrix.python-version == '3.11' }}
- name: "Build Package 📦"
run: |
git describe --tags --exact-match > VERSION || true
python -m build
- uses: actions/upload-artifact@v4
# Only publish artifacts from Python latest build.
if: ${{ matrix.python-version == '3.11' }}
with:
name: dist
path: dist/
if-no-files-found: error
release:
name: "Release 🚀"
runs-on: ubuntu-latest
needs:
- test
- docs
- lint
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Release to PyPi 📦
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: dist/*