Skip to content

Commit f2c83b6

Browse files
Copilotliudger
andcommitted
Improve uv setup in GitHub Actions workflows using official astral-sh/setup-uv action
Co-authored-by: liudger <4112111+liudger@users.noreply.github.com>
1 parent c844604 commit f2c83b6

4 files changed

Lines changed: 30 additions & 10 deletions

File tree

.github/workflows/linting.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
- name: ⤵️ Check out code from GitHub
1919
uses: actions/checkout@v4.2.2
2020
- name: 🏗 Set up uv
21-
run: pipx install uv
21+
uses: astral-sh/setup-uv@v4
22+
with:
23+
enable-cache: true
2224
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
2325
id: python
2426
uses: actions/setup-python@v5.6.0
@@ -36,7 +38,9 @@ jobs:
3638
- name: ⤵️ Check out code from GitHub
3739
uses: actions/checkout@v4.2.2
3840
- name: 🏗 Set up uv
39-
run: pipx install uv
41+
uses: astral-sh/setup-uv@v4
42+
with:
43+
enable-cache: true
4044
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
4145
id: python
4246
uses: actions/setup-python@v5.6.0
@@ -56,7 +60,9 @@ jobs:
5660
- name: ⤵️ Check out code from GitHub
5761
uses: actions/checkout@v4.2.2
5862
- name: 🏗 Set up uv
59-
run: pipx install uv
63+
uses: astral-sh/setup-uv@v4
64+
with:
65+
enable-cache: true
6066
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
6167
id: python
6268
uses: actions/setup-python@v5.6.0
@@ -98,7 +104,9 @@ jobs:
98104
- name: ⤵️ Check out code from GitHub
99105
uses: actions/checkout@v4.2.2
100106
- name: 🏗 Set up uv
101-
run: pipx install uv
107+
uses: astral-sh/setup-uv@v4
108+
with:
109+
enable-cache: true
102110
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
103111
id: python
104112
uses: actions/setup-python@v5.6.0
@@ -116,7 +124,9 @@ jobs:
116124
- name: ⤵️ Check out code from GitHub
117125
uses: actions/checkout@v4.2.2
118126
- name: 🏗 Set up uv
119-
run: pipx install uv
127+
uses: astral-sh/setup-uv@v4
128+
with:
129+
enable-cache: true
120130
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
121131
id: python
122132
uses: actions/setup-python@v5.6.0
@@ -134,7 +144,9 @@ jobs:
134144
- name: ⤵️ Check out code from GitHub
135145
uses: actions/checkout@v4.2.2
136146
- name: 🏗 Set up uv
137-
run: pipx install uv
147+
uses: astral-sh/setup-uv@v4
148+
with:
149+
enable-cache: true
138150
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
139151
id: python
140152
uses: actions/setup-python@v5.6.0

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
- name: ⤵️ Check out code from GitHub
2525
uses: actions/checkout@v4.2.2
2626
- name: 🏗 Set up uv
27-
run: pipx install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
2830
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
2931
id: python
3032
uses: actions/setup-python@v5.6.0

.github/workflows/tests.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
- name: ⤵️ Check out code from GitHub
2222
uses: actions/checkout@v4.2.2
2323
- name: 🏗 Set up uv
24-
run: pipx install uv
24+
uses: astral-sh/setup-uv@v4
25+
with:
26+
enable-cache: true
2527
- name: 🏗 Set up Python ${{ matrix.python }}
2628
id: python
2729
uses: actions/setup-python@v5.6.0
@@ -49,7 +51,9 @@ jobs:
4951
- name: ⬇️ Download coverage data
5052
uses: actions/download-artifact@v4.3.0
5153
- name: 🏗 Set up uv
52-
run: pipx install uv
54+
uses: astral-sh/setup-uv@v4
55+
with:
56+
enable-cache: true
5357
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
5458
id: python
5559
uses: actions/setup-python@v5.6.0

.github/workflows/typing.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
- name: ⤵️ Check out code from GitHub
1919
uses: actions/checkout@v4.2.2
2020
- name: 🏗 Set up uv
21-
run: pipx install uv
21+
uses: astral-sh/setup-uv@v4
22+
with:
23+
enable-cache: true
2224
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
2325
id: python
2426
uses: actions/setup-python@v5.6.0

0 commit comments

Comments
 (0)