Skip to content

Commit

Permalink
Fix GitHub workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ropable committed Nov 20, 2024
1 parent 3596c28 commit db95460
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- "3.12"

steps:
#----------------------------------------------
# Check-out repo and set up Python
#----------------------------------------------
- name: Checkout repo
uses: actions/checkout@v4
id: checkout-repo
Expand All @@ -25,20 +28,40 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# Install & configure Poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
#----------------------------------------------
# Load cached venv if cache exists
#----------------------------------------------
- name: Caches
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# Install dependencies if cache does not exist
#----------------------------------------------
- name: Install non-cached dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-ansi
run: poetry install --no-interaction --no-root
#----------------------------------------------
# Install the root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction
#----------------------------------------------
# Run unit tests
#----------------------------------------------
- name: Tox tests
run: tox -v
run: |
source .venv/bin/activate
tox -v

0 comments on commit db95460

Please sign in to comment.