Skip to content

Commit

Permalink
chore: replace custom cache step with config (#11572)
Browse files Browse the repository at this point in the history
* chore: replace custom cache step with config

The `actions/setup-python@v2` and higher included a built-in cache
restore and post-run save step, meaning we can now retire our custom
steps for the configuration we want and gain some speed here.

Refs: actions/setup-python#266
Refs: https://github.com/actions/setup-python#caching-packages-dependencies

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* chore: replace custom cache step with config

The `actions/setup/node@v2` introduced support for configuring cache for
npm.
Since we use defaults, no changes are necessary other than setting the
installer type.

Refs: actions/setup-node#272

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
  • Loading branch information
miketheman committed Jun 15, 2022
1 parent 768d5e2 commit ac62bb7
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions .github/workflows/ci.yml
Expand Up @@ -68,18 +68,10 @@ jobs:
if: ${{ matrix.needs-python }}
with:
python-version-file: '.python-version'
- name: Cache Python dependencies
if: ${{ matrix.needs-python }}
uses: actions/cache@v3
env:
cache-name: warehouse-cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
${{ runner.os }}-${{ github.job }}-
${{ runner.os }}-
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements/*.txt
- name: Install Python dependencies
if: ${{ matrix.needs-python }}
run: |
Expand All @@ -90,19 +82,7 @@ jobs:
if: ${{ matrix.needs-node }}
with:
node-version: 14.15.5
- name: Cache Node dependencies
if: ${{ matrix.needs-node }}
uses: actions/cache@v2
env:
cache-name: warehouse-cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
${{ runner.os }}-build-${{ github.job }}-
${{ runner.os }}-build-
${{ runner.os }}-
cache: 'npm'
- name: Install Node dependencies
if: ${{ matrix.needs-node }}
run: npm ci
Expand Down

0 comments on commit ac62bb7

Please sign in to comment.