From 55f15a0271e565a0e81762a739f5b9c79921c1f4 Mon Sep 17 00:00:00 2001 From: Amit Parekh <7276308+amitkparekh@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:16:35 +0100 Subject: [PATCH] ci: create install_deps step before the rest I think the deps caching step is crashing with basedpyright, so I'm putting that earlier so it won't be trying to re-cache it after the basedpyright step. --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a85fca..3a96ef0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: id: filter with: filters: | + deps: + - 'pyproject.toml' + - 'pdm.lock' python: - '**/*.py' - 'storage/fixtures/**/*' @@ -44,9 +47,26 @@ jobs: pre_commit_config: - '.pre-commit-config.yaml' - test: + install_deps: runs-on: ubuntu-latest needs: [changes] + if: ${{needs.changes.outputs.deps == 'true' && !github.event.pull_request.draft }} + steps: + - name: Checkpout repository + uses: actions/checkout@v4 + + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: true + + - name: Install dependencies + run: pdm install + + test: + runs-on: ubuntu-latest + needs: [changes, install_deps] if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }} steps: - name: Checkpout repository @@ -107,7 +127,7 @@ jobs: based_pyright: runs-on: ubuntu-latest - needs: [changes] + needs: [changes, install_deps] if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }} steps: - name: Checkout repository