Skip to content

Commit 41d340d

Browse files
committed
ci: cache hatch and nitpick dirs
1 parent 8d1abb4 commit 41d340d

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/python-tests.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ env:
1010
PYTHONUNBUFFERED: "1"
1111
FORCE_COLOR: "1"
1212
HATCH_VERSION: "1.15.1"
13+
HATCH_DATA_DIR: "~/.hatch"
14+
HATCH_CACHE_DIR: "~/.cache/hatch"
1315

1416
jobs:
1517
test:
@@ -41,13 +43,30 @@ jobs:
4143
python-version: "${{matrix.python-version}}"
4244
cache: "pip"
4345

46+
- name: Cache hatch
47+
uses: actions/[email protected]
48+
with:
49+
path: |
50+
~/.cache/hatch
51+
~/.hatch
52+
key: hatch-${{runner.os}}-${{matrix.python-version}}-${{hashFiles('pyproject.toml')}}
53+
restore-keys: |
54+
hatch-${{runner.os}}-${{matrix.python-version}}-
55+
hatch-${{runner.os}}-
56+
57+
- name: Cache nitpick
58+
uses: actions/[email protected]
59+
with:
60+
path: .cache/nitpick
61+
key: nitpick-${{runner.os}}-${{matrix.python-version}}
62+
restore-keys: |
63+
nitpick-${{runner.os}}-
64+
4465
- name: Install Hatch
4566
uses: pypa/hatch@install
4667
with:
4768
version: "${{ env.HATCH_VERSION }}"
4869

49-
- run: hatch env find
50-
5170
- name: Run type check
5271
run: hatch run types:check
5372

0 commit comments

Comments
 (0)