Clean up our actions/cache step

Removed name because it was not more informative than the default. Swapped out
a hardcoded job reference for the github.job context value. Switch the base
cache key to a step environment value so we can set it once and reuse. Removed
additional restore-key value that might have undesirable results.
pull/113/head
Nicholas McDonnell 4 years ago
parent 3b312c43d4
commit f4131e57d8
No known key found for this signature in database
GPG Key ID: 7994ADE2A56BE5D1
  1. 14
      .github/workflows/build.yml

@ -20,22 +20,20 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache linting environments
uses: actions/cache@v2
- uses: actions/cache@v2
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-"
with:
path: |
${{ env.PIP_CACHE_DIR }}
${{ env.PRE_COMMIT_CACHE_DIR }}
key: |
lint-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-\
key: "${{ env.BASE_CACHE_KEY }}\
${{ hashFiles('**/requirements-test.txt') }}-\
${{ hashFiles('**/requirements.txt') }}-\
${{ hashFiles('**/.pre-commit-config.yaml') }}"
restore-keys: |
lint-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-
lint-${{ runner.os }}-
${{ env.BASE_CACHE_KEY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip

Loading…
Cancel
Save