Skip to content

Commit

Permalink
Use actions/setup-python's pip cache
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 18, 2021
1 parent d6e42f3 commit b744e79
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: lint-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
lint-pip-
- name: pre-commit cache
uses: actions/cache@v2
with:
Expand All @@ -31,7 +23,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"
cache: pip
cache-dependency-path: "setup.py"

- name: Build system information
run: python3 .github/workflows/system-info.py
Expand All @@ -45,4 +39,3 @@ jobs:
run: tox -e lint
env:
PRE_COMMIT_COLOR: always

12 changes: 2 additions & 10 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,14 @@ jobs:
repository: python-pillow/pillow-depends
path: winbuild\depends

- name: Cache pip
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key:
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ hashFiles('**/.github/workflows/test-windows.yml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}-
${{ runner.os }}-${{ matrix.python-version }}-
# sets env: pythonLocation
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
cache: pip
cache-dependency-path: ".github/workflows/test-windows.yml"

- name: Print build system information
run: python .github/workflows/system-info.py
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(python3 -m pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.ci/*.sh') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
cache: pip
cache-dependency-path: "**/.ci/*.sh"

- name: Build system information
run: python3 .github/workflows/system-info.py
Expand Down

0 comments on commit b744e79

Please sign in to comment.