Skip to content

Commit

Permalink
chore: Update GHA (#5)
Browse files Browse the repository at this point in the history
* chore: update gha

* chore: update GHA

* chore: update gha
  • Loading branch information
msto committed Mar 25, 2024
1 parent 3a99190 commit f638405
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Python tests and code checks
name: Code checks

on: [push]

env:
POETRY_VERSION: 1.6
POETRY_VERSION: 1.8.2

jobs:
testing:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -19,32 +19,11 @@ jobs:
with:
python-version: ${{ matrix.PYTHON_VERSION }}

- name: Get full Python version
id: full-python-version
shell: bash
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Install poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry==${{env.POETRY_VERSION}}
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv

- name: Test the lock file is up to date
run: python -m poetry check --lock

Expand All @@ -53,3 +32,4 @@ jobs:

- name: Test the library
run: poetry run pytest

0 comments on commit f638405

Please sign in to comment.