From ceaad5139d8ddcebd182dddbf097df4c9aaf7fb5 Mon Sep 17 00:00:00 2001 From: ljnsn Date: Fri, 9 May 2025 01:36:21 +0200 Subject: [PATCH] ci: use poetry action and update --- .github/workflows/lint_and_test.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index fa6a57b..46cde30 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -21,25 +21,25 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} - - uses: actions/cache@v4 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-root - name: Install poetry - if: steps.cache.outputs.cache-hit != 'true' - run: | - python -m pip install --upgrade pip - python -m pip install poetry + uses: abatilo/actions-poetry@v3 + with: + poetry-version: "2.1.2" - name: Configure poetry - run: python -m poetry config virtualenvs.create false + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v4 + name: Define a cache for the virtual environment based on the dependencies lock file + with: + path: ./.venv + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-venv - name: Install Dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: python -m poetry install + run: poetry install - name: Lint with black run: | # stop the build if there are Python syntax errors or undefined names - black --check --diff pandas_ods_reader/ tests/ + poetry run black --check --diff pandas_ods_reader/ tests/ - name: Test with pytest run: | - python -m pytest tests/ + poetry run pytest tests/