v0.1.3beta #13
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up testing python ${{ matrix.config.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.config.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2.3.0 | |
- name: Setup a local virtual environment for caching | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- name: Define a cache for the virtual environment based on the dependencies lock file to speed up later runs | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install --no-root | |
- name: Pytest | |
run: poetry run pytest -x | |
build-and-publish: | |
name: Build and publish Python distributions 📦 to PyPI and TestPyPI | |
runs-on: ubuntu-22.04 | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up base Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Python Poetry Action | |
uses: abatilo/actions-poetry@v2.3.0 | |
- name: Publish distribution 📦 with test.pypi.org | |
if: startsWith(github.ref, 'refs/tags') | |
run: | | |
poetry config repositories.testpypi https://test.pypi.org/legacy/ | |
poetry config pypi-token.testpypi ${{ secrets.PYPI_TEST_TOKEN }} | |
poetry build | |
poetry publish -r testpypi |