Skip to content

poetry ci

poetry ci #165

Workflow file for this run

name: poetry ci
on: pull_request
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v4
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: |
source $VENV
pytest
- name: Lint
run: |
source $VENV
flake8 . || echo "Linting errors found, but we're treating this as a warning."
- name: Format
run: |
source $VENV
black . --check || echo "Formatting errors found, but we're treating this as a warning."