Skip to content

Commit 49005a5

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

File tree

3 files changed

+46
-69
lines changed

3 files changed

+46
-69
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/lib-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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"

.github/workflows/sync-uv.yml

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

0 commit comments

Comments
 (0)