Skip to content

separate test and doc workflows, run tests on matrix of python versions #40

separate test and doc workflows, run tests on matrix of python versions

separate test and doc workflows, run tests on matrix of python versions #40

Workflow file for this run

name: Starling
on:
push:
branches: [ "main", "release-0.1.4" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v3
- name: Install Poetry
with:
virtualenvs-create: true
virtualenvs-in-project: true
uses: snok/install-poetry@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install project
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with docs,dev --no-interaction
- uses: isort/isort-action@v1
- name: Black
run: |
poetry run black --check --verbose ./starling
- name: Pytest
run: |
poetry run pytest
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
with:
virtualenvs-create: true
virtualenvs-in-project: true
uses: snok/install-poetry@v1
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'
- name: Install project
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with docs,dev --no-interaction
- name: Build documentation
run: |
mkdir gh-pages
touch gh-pages/.nojekyll
cd docs/source
poetry run sphinx-build -b html . ../build
cp -r ../build/* ../../gh-pages/
- name: Deploy documentation
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages