From b337396144e6071aa9a6930010368fad2c3c1b1e Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Mon, 1 Feb 2021 15:48:03 +0300 Subject: [PATCH] cache pip directory on github actions (#5365) --- .github/workflows/tests.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 791001e40..2d18757b5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -52,7 +52,20 @@ jobs: uses: actions/setup-python@v2.1.4 with: python-version: ${{ matrix.pyv }} + - name: get pip cache dir + id: pip-cache-dir + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: set pip cache + id: pip-cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache-dir.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- - name: install + if: steps.cache.pip-cache-dir.cache-hit != 'true' run: | pip install wheel pip install -e ".[all,tests]"