From 4ad496aac4f1404c19b4953b38ee20996be6c372 Mon Sep 17 00:00:00 2001 From: Michael Beale Date: Wed, 2 Oct 2024 08:02:56 -0700 Subject: [PATCH] Update run_unittests.yaml --- .github/workflows/run_unittests.yaml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_unittests.yaml b/.github/workflows/run_unittests.yaml index 81ce5d2..1421ea1 100644 --- a/.github/workflows/run_unittests.yaml +++ b/.github/workflows/run_unittests.yaml @@ -24,13 +24,28 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.12" - - name: Poetry setup - # You may pin to the exact commit or the version. - uses: ClementWalter/poetry-action@845abd0cfcc6671c045a2f9df189360bb73e64c4 + - name: Install Poetry + run: | + python -m pip install --upgrade pip + python -m pip install poetry + poetry config virtualenvs.create true + poetry config virtualenvs.in-project false + poetry config virtualenvs.path .virtualenvs + - name: Poetry Version + id: poetry-version + run: echo "::set-output name=version::$(poetry --version | grep -oP '[\d\.]+')" + - name: Cache Poetry virtualenv + uses: actions/cache@v2 + id: cache with: - os: "ubuntu-latest" - python-version: "3.12" - + path: .virtualenvs + key: ${{ inputs.os }}-${{ inputs.python-version }}-poetry-${{ steps.poetry-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ inputs.os }}-${{ inputs.python-version }}-poetry-${{ steps.poetry-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + run: | + poetry install + if: steps.cache.outputs.cache-hit != 'true' - name: Test with pytest run: | pytest