From 27a122088cdba445465428da6e7680c9a22e6c74 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 18 Jan 2021 11:02:55 -0500 Subject: [PATCH] Use pip cache on GitHub Actions Using the method outlined in https://github.com/actions/cache/blob/main/examples.md#using-pip-to-get-cache-location --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50a1a3d2f..8ca015e07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,19 @@ jobs: pip install --upgrade codecov tox setuptools pip pip list + - name: Get pip cache directory + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: pip cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Display tool versions run: python misc/build_helpers/show-tool-versions.py @@ -117,6 +130,19 @@ jobs: pip install --upgrade tox pip pip list + - name: Get pip cache directory + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: pip cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Display tool versions run: python misc/build_helpers/show-tool-versions.py @@ -169,6 +195,19 @@ jobs: pip install --upgrade tox pip pip list + - name: Get pip cache directory + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: pip cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Display tool versions run: python misc/build_helpers/show-tool-versions.py