Enable Poetry's virtual env in CI #46
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: CI | |
on: [push, pull_request] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install -U pip poetry | |
- run: poetry install | |
- run: poetry run ruff check src/ tests/ | |
- run: poetry run ruff format --diff --check src/ tests/ | |
- run: poetry run mypy src/ tests/ | |
- run: poetry run pytest | |
cd: | |
needs: [ci] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python | |
if: startsWith(github.event.ref, 'refs/tags') | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.12" | |
- run: pip install -U pip poetry | |
- name: Publish package | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} |