From c507c3359e0f155cb5d709613682aece7798d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 13 Aug 2023 04:06:17 +0200 Subject: [PATCH] Enable pip caching for GitHub Actions Enable pip caching in order to avoid repeatedly rebuilding all the PyPy wheels for source packages. This is inspired by discussion in https://github.com/psf/requests/pull/6496 and it may help with the PyPy CI failures. --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ce0dc98..2f94456d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,21 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + # from https://github.com/actions/cache/blob/main/examples.md#python---pip + - name: Get pip cache dir + id: pip-cache + run: | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT + + - name: pip cache + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache.outputs.dir }} + # the action does not permit updating an existing cache, so we need + # unique keys + key: ${{ runner.os }}-pip-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-pip- - name: Install dependencies run: | python -m pip install .