Skip to content

Commit ac62bb7

Browse files
authored
chore: replace custom cache step with config (#11572)
* 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 <[email protected]> * 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 <[email protected]>
1 parent 768d5e2 commit ac62bb7

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,10 @@ jobs:
6868
if: ${{ matrix.needs-python }}
6969
with:
7070
python-version-file: '.python-version'
71-
- name: Cache Python dependencies
72-
if: ${{ matrix.needs-python }}
73-
uses: actions/cache@v3
74-
env:
75-
cache-name: warehouse-cache-pip
76-
with:
77-
path: ~/.cache/pip
78-
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }}
79-
restore-keys: |
80-
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
81-
${{ runner.os }}-${{ github.job }}-
82-
${{ runner.os }}-
71+
cache: 'pip'
72+
cache-dependency-path: |
73+
requirements.txt
74+
requirements/*.txt
8375
- name: Install Python dependencies
8476
if: ${{ matrix.needs-python }}
8577
run: |
@@ -90,19 +82,7 @@ jobs:
9082
if: ${{ matrix.needs-node }}
9183
with:
9284
node-version: 14.15.5
93-
- name: Cache Node dependencies
94-
if: ${{ matrix.needs-node }}
95-
uses: actions/cache@v2
96-
env:
97-
cache-name: warehouse-cache-npm
98-
with:
99-
path: ~/.npm
100-
key: ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
101-
restore-keys: |
102-
${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
103-
${{ runner.os }}-build-${{ github.job }}-
104-
${{ runner.os }}-build-
105-
${{ runner.os }}-
85+
cache: 'npm'
10686
- name: Install Node dependencies
10787
if: ${{ matrix.needs-node }}
10888
run: npm ci

0 commit comments

Comments
 (0)