put example in examples/ #17
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: Python package | |
on: [push] | |
jobs: | |
pre-commit-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install deps | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry==1.6.1 | |
poetry install | |
- name: Assert pre-commit has run (linting, etc.) | |
run: | | |
poetry run pre-commit run --all-files | |
test: | |
needs: pre-commit-check | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 3 | |
matrix: | |
python-version: ["3.9", "3.10", '3.11'] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install deps | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry==1.6.1 | |
poetry install | |
- name: Run tests | |
run: | | |
poetry run pytest tests | |
semantic-release: | |
needs: test | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install deps | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry==1.6.1 | |
poetry install | |
- name: Run semantic release | |
run: | | |
poetry config pypi-token.pypi "$PYPI_TOKEN" | |
make release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |