Skip to content

Commit 829eb41

Browse files
authored
Add caching to the GHA workflow (python#880)
1 parent f530b8c commit 829eb41

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
python-version: 3.9
2121
- name: Install dependencies
2222
run: |
23-
python -m pip install --upgrade pip
23+
pip install --upgrade pip
2424
pip install -r docs/requirements.txt
2525
- name: Build the documentation
2626
run: make -C docs html

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ jobs:
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929

30+
- name: Load pip cache
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.cache/pip
34+
key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-
37+
3038
- name: Install dependencies
3139
run: |
32-
python -m pip install --upgrade pip
40+
pip install --upgrade pip
3341
pip install -r test-requirements.txt
3442
3543
- name: Run tests
@@ -56,9 +64,17 @@ jobs:
5664
with:
5765
python-version: 3.9
5866

67+
- name: Load pip cache
68+
uses: actions/cache@v2
69+
with:
70+
path: ~/.cache/pip
71+
key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
72+
restore-keys: |
73+
${{ runner.os }}-pip-
74+
5975
- name: Install dependencies
6076
run: |
61-
python -m pip install --upgrade pip
77+
pip install --upgrade pip
6278
pip install -r test-requirements.txt
6379
6480
- name: Lint implementation

0 commit comments

Comments
 (0)