Skip to content

Commit

Permalink
testing: upgrade of poetry workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pahrohfit committed Mar 19, 2024
1 parent 4c341e7 commit 4a88b71
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/unit_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,35 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
include:
- VENV: .venv/bin/activate
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
#cache: 'poetry'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#with:
#virtualenvs-create: true
#virtualenvs-in-project: true
#installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached dotvenv
id: cached-poetry-dotvenv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
#key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/main.yml') }}

- name: Load cached dotlocal
Expand All @@ -48,6 +50,13 @@ jobs:
path: ~/.local
key: dotlocal-${{ runner.os }}-${{ hashFiles('.github/workflows/main.yml') }}

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
Expand Down

0 comments on commit 4a88b71

Please sign in to comment.