From 4a69ff71865bbaa6cb55076a03b9a2eaa7b74d38 Mon Sep 17 00:00:00 2001 From: Emanuele Panizio Date: Thu, 28 Mar 2024 12:28:30 +0100 Subject: [PATCH] ensure poetry is installed during github workflow execution and cache is enabled --- .github/workflows/release.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b2747c0..1f4a84a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,17 +13,23 @@ jobs: python-version: ["3.10"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + + - uses: actions/checkout@v4 + - name: Install Python uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - - name: Install dependencies + - name: Install poetry + uses: abatilo/actions-poetry@v2 + - name: Setup a local virtual environment (if no poetry.toml file) run: | - curl -sSL https://install.python-poetry.org | POETRY_VIRTUALENVS_IN_PROJECT=true python3 - && \ - poetry install --no-cache --compile --only main - + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v3 + name: Define a cache for the virtual environment based on the dependencies lock file + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + - name: Install the project dependencies + run: poetry install # files in data do not change unless # repo URL is updated and new file is downloaded - name: Cache Polygons @@ -36,7 +42,7 @@ jobs: - name: Build gazetteer run: | mkdir -p ./data - python build.py + poetry run python -B build.py - name: Changelog uses: scottbrenner/generate-changelog-action@master id: Changelog