From 5bab7d72220846c389d11ae68f0f76a00619228b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Wo=C5=BAniak?= <17177420+wozniakpl@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:30:00 +0200 Subject: [PATCH] add caching --- .github/workflows/ci.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0178f42..1a6f4c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,23 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - name: Install dependencies - run: | - python -m pip install pdm - pdm install - - name: Run tests - run: | - docker compose run --rm -d db - pdm run pytest \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + python-version: 3.12 + - name: Cache PDM packages + uses: actions/cache@v4 + with: + path: __pypackages__ + key: ${{ runner.os }}-pdm-${{ hashFiles('pdm.lock') }} + restore-keys: | + ${{ runner.os }}-pdm- + - name: Install dependencies + run: | + python -m pip install pdm + pdm install + - name: Run tests + run: | + docker compose run --rm -d db + nc --help + pdm run pytest