Skip to content

Commit 0fdf0f6

Browse files
committed
💚 Refactor sync-uv workflow to use composite actions and update references
1 parent 931e888 commit 0fdf0f6

File tree

7 files changed

+52
-75
lines changed

7 files changed

+52
-75
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Sync UV
2+
description: "Setup and sync UV environment"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: "Install uv"
8+
uses: astral-sh/setup-uv@v6
9+
with:
10+
enable-cache: true
11+
12+
- name: "Build groups args"
13+
id: groups
14+
run: |
15+
args=""
16+
if [ -n "${{ inputs.groups }}" ]; then
17+
IFS=',' read -ra GROUPS <<< "${{ inputs.groups }}"
18+
for group in "${GROUPS[@]}"; do
19+
group=$(echo "$group" | xargs)
20+
[ -n "$group" ] && args="$args --group $(printf %q "$group")"
21+
done
22+
fi
23+
echo "value=$args" >> $GITHUB_OUTPUT
24+
25+
- name: "Build extras args"
26+
id: extras
27+
run: |
28+
args=""
29+
if [ -n "${{ inputs.extras }}" ]; then
30+
IFS=',' read -ra EXTRAS <<< "${{ inputs.extras }}"
31+
for extra in "${EXTRAS[@]}"; do
32+
extra=$(echo "$extra" | xargs)
33+
[ -n "$extra" ] && args="$args --extra $(printf %q "$extra")"
34+
done
35+
fi
36+
echo "value=$args" >> $GITHUB_OUTPUT
37+
38+
- name: "Run UV sync"
39+
run: |
40+
cmd="uv sync${{ steps.groups.outputs.value }}${{ steps.extras.outputs.value }}"
41+
echo "Executing: $cmd"
42+
eval "$cmd"
43+
env:
44+
UV_NO_PYTHON_DOWNLOADS: ${{ inputs.no_python_downloads && '1' || '' }}
45+
UV_FROZEN: ${{ inputs.frozen && '1' || '' }}

.github/workflows/docs-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
python-version: "3.13"
4444
- name: "Setup UV"
45-
uses: ./.github/workflows/sync-uv.yml
45+
uses: ./.github/actions/uv-setup
4646
with:
4747
groups: 'dev,docs'
4848
- name: "Check Links"

.github/workflows/docs-localization-download.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
python-version: "3.13"
2323
- name: "Setup UV"
24-
uses: ./.github/workflows/sync-uv.yml
24+
uses: ./.github/actions/uv-setup
2525
with:
2626
groups: 'dev,docs'
2727
extras: 'speed,voice'

.github/workflows/docs-localization-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
python-version: "3.13"
2828
- name: "Setup UV"
29-
uses: ./.github/workflows/sync-uv.yml
29+
uses: ./.github/actions/uv-setup
3030
with:
3131
groups: 'dev,docs'
3232
extras: 'speed,voice'

.github/workflows/lib-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: "Checkout Repository"
3535
uses: actions/checkout@v5
3636
- name: "Setup UV"
37-
uses: ./.github/workflows/sync-uv.yml
37+
uses: ./.github/actions/uv-setup
3838
with:
3939
groups: 'dev'
4040
- name: "Run codespell"
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
python-version: "3.13"
5353
- name: "Setup UV"
54-
uses: ./.github/workflows/sync-uv.yml
54+
uses: ./.github/actions/uv-setup
5555
with:
5656
groups: 'dev'
5757
- name: "Run ruff linter check"
@@ -69,7 +69,7 @@ jobs:
6969
with:
7070
python-version: "3.13"
7171
- name: "Setup UV"
72-
uses: ./.github/workflows/sync-uv.yml
72+
uses: ./.github/actions/uv-setup
7373
with:
7474
groups: 'dev'
7575
- name: "Setup cache"

.github/workflows/sync-guild-features.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
python-version: "3.13"
2727
- name: "Setup UV"
28-
uses: ./.github/workflows/sync-uv.yml
28+
uses: ./.github/actions/uv-setup
2929
with:
3030
groups: 'dev,ci'
3131
- name: "Run guild features sync"

.github/workflows/sync-uv.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)