Skip to content

Commit 5d5567d

Browse files
committed
Add GitHub action caching of pre-commit hooks and pip packages.
1 parent 12b91c4 commit 5d5567d

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ on: [push]
55

66
jobs:
77
build:
8-
98
runs-on: ubuntu-latest
10-
119
steps:
1210
- uses: actions/checkout@v1
1311

@@ -16,6 +14,25 @@ jobs:
1614
with:
1715
python-version: 3.7
1816

17+
- name: Cache pre-commit hooks
18+
uses: actions/cache@v1
19+
with:
20+
path: ~/.cache/pre-commit
21+
key: "${{ runner.os }}-pre-commit-\
22+
${{ hashFiles('**/.pre-commit-config.yaml') }}"
23+
restore-keys: |
24+
${{ runner.os }}-pre-commit-
25+
26+
- name: Cache pip test requirements
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.cache/pip
30+
key: "${{ runner.os }}-pip-test-\
31+
${{ hashFiles('**/requirements-test.txt') }}"
32+
restore-keys: |
33+
${{ runner.os }}-pip-test-
34+
${{ runner.os }}-pip-
35+
1936
- name: Install dependencies
2037
run: |
2138
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)