Skip to content

Commit 75a6bf7

Browse files
matsumotosanBorda
andauthored
code check with uv (#21183)
* code check with uv * prune cache * add back mypy cache --- Co-authored-by: Jirka Borovec <[email protected]>
1 parent 22132aa commit 75a6bf7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/code-checks.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,32 @@ jobs:
2929
runs-on: ubuntu-22.04
3030
steps:
3131
- uses: actions/checkout@v5
32-
- uses: actions/setup-python@v6
33-
with:
34-
python-version: "3.11"
3532

36-
- name: Mypy cache
37-
uses: actions/cache@v4
33+
- name: Install uv and set Python version
34+
uses: astral-sh/setup-uv@v6
3835
with:
39-
path: .mypy_cache
40-
key: mypy-${{ hashFiles('requirements/typing.txt') }}
36+
python-version: "3.11"
37+
# TODO: Avoid activating environment like this
38+
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
39+
activate-environment: true
40+
enable-cache: true
4141

4242
- name: Install dependencies
4343
env:
4444
FREEZE_REQUIREMENTS: 1
4545
timeout-minutes: 20
4646
run: |
47-
pip install -e '.[pytorch-all,fabric-all]' -r requirements/typing.txt
48-
pip list
47+
uv pip install '.[pytorch-all,fabric-all]' -r requirements/typing.txt
48+
uv pip list
49+
50+
- name: mypy cache
51+
uses: actions/cache@v4
52+
with:
53+
path: .mypy_cache
54+
key: mypy-${{ hashFiles('requirements/typing.txt') }}
4955

5056
- name: Check typing
5157
run: mypy
58+
59+
- name: Minimize uv cache
60+
run: uv cache prune --ci

0 commit comments

Comments
 (0)