Skip to content

Commit

Permalink
Use cache action to cache pip on all OS's
Browse files Browse the repository at this point in the history
  • Loading branch information
yaugenst committed Nov 19, 2023
1 parent ae29ebe commit a19c33f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Set pip cache directory
id: pip-cache
run: |
if [[ $RUNNER_OS == 'Windows' ]]; then
echo "::set-output name=dir::C:\\Users\\runneradmin\\AppData\\Local\\pip\\Cache"
else
echo "::set-output name=dir::~/.cache/pip"
fi
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
Expand Down

0 comments on commit a19c33f

Please sign in to comment.