2022-11-10 02:22:33 +00:00
|
|
|
name: Python package
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-10 02:24:28 +00:00
|
|
|
python-version: ["3.10", "3.11"]
|
2022-11-10 02:22:33 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: cache poetry install
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.local
|
|
|
|
key: poetry-1.2.1
|
|
|
|
- uses: snok/install-poetry@v1
|
|
|
|
with:
|
|
|
|
version: 1.2.1
|
|
|
|
virtualenvs-create: true
|
|
|
|
virtualenvs-in-project: true
|
|
|
|
- name: cache deps
|
|
|
|
id: cache-deps
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: .venv
|
|
|
|
key: pydeps-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- run: poetry install --no-interaction --no-root
|
|
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
- run: poetry install --no-interaction
|
|
|
|
- run: poetry run pytest
|