From db9546026337d86301173c2224b9108449e4c10f Mon Sep 17 00:00:00 2001 From: Ashley Felton Date: Wed, 20 Nov 2024 14:15:58 +0800 Subject: [PATCH] Fix GitHub workflow. --- .github/workflows/run-tests.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e8c0cbe..612fa9d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 @@ -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