Bump the pip group with 4 updates #44
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: | |
branches: | |
- '*' | |
tags: | |
- '*.*.*' | |
pull_request: | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.10"] | |
poetry-version: ["1.2.2"] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
# Note: config for poetry is in poetry.toml in package root dir | |
- name: Install poetry | |
run: pipx install "poetry==${{ matrix.poetry-version }}" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install package | |
run: poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest --capture=no | |
- name: Build package | |
if: ${{ github.ref_type == 'tag' }} | |
run: poetry build | |
- name: Publish tags to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ github.ref_type == 'tag' }} | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |