File tree Expand file tree Collapse file tree 1 file changed +68
-0
lines changed Expand file tree Collapse file tree 1 file changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Sync UV
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ groups :
6
+ description : " Comma-separated list of groups to sync"
7
+ required : false
8
+ type : string
9
+ default : ' '
10
+ extras :
11
+ description : " Comma-separated list of extras to sync"
12
+ required : false
13
+ type : string
14
+ default : ' '
15
+ frozen :
16
+ description : " Whether to sync with frozen dependencies"
17
+ required : false
18
+ type : boolean
19
+ default : true
20
+ no_python_downloads :
21
+ description : " Whether to avoid downloading Python versions"
22
+ required : false
23
+ type : boolean
24
+ default : true
25
+
26
+ jobs :
27
+ sync :
28
+ runs-on : ubuntu-latest
29
+ steps :
30
+ - name : " Install uv"
31
+ uses : astral-sh/setup-uv@v6
32
+ with :
33
+ enable-cache : true
34
+
35
+ - name : " Build groups args"
36
+ id : groups
37
+ run : |
38
+ args=""
39
+ if [ -n "${{ inputs.groups }}" ]; then
40
+ IFS=',' read -ra GROUPS <<< "${{ inputs.groups }}"
41
+ for group in "${GROUPS[@]}"; do
42
+ group=$(echo "$group" | xargs)
43
+ [ -n "$group" ] && args="$args --group $(printf %q "$group")"
44
+ done
45
+ fi
46
+ echo "value=$args" >> $GITHUB_OUTPUT
47
+
48
+ - name : " Build extras args"
49
+ id : extras
50
+ run : |
51
+ args=""
52
+ if [ -n "${{ inputs.extras }}" ]; then
53
+ IFS=',' read -ra EXTRAS <<< "${{ inputs.extras }}"
54
+ for extra in "${EXTRAS[@]}"; do
55
+ extra=$(echo "$extra" | xargs)
56
+ [ -n "$extra" ] && args="$args --extra $(printf %q "$extra")"
57
+ done
58
+ fi
59
+ echo "value=$args" >> $GITHUB_OUTPUT
60
+
61
+ - name : " Run UV sync"
62
+ run : |
63
+ cmd="uv sync${{ steps.groups.outputs.value }}${{ steps.extras.outputs.value }}"
64
+ echo "Executing: $cmd"
65
+ eval "$cmd"
66
+ env :
67
+ UV_NO_PYTHON_DOWNLOADS : ${{ inputs.no_python_downloads && '1' || '' }}
68
+ UV_FROZEN : ${{ inputs.frozen && '1' || '' }}
You can’t perform that action at this time.
0 commit comments