Skip to content

Commit 4f9229c

Browse files
committed
add uv update workflow
1 parent fcbdd8d commit 4f9229c

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

.github/workflows/uv-update.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Sync uv.lock
2+
3+
on:
4+
schedule:
5+
# Every Monday at 03:00 UTC; adjust as needed
6+
- cron: "0 3 * * 1"
7+
push:
8+
branches: [main]
9+
paths:
10+
- 'pyproject.toml'
11+
- 'setup.py'
12+
workflow_dispatch: # allow manual runs
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
jobs:
19+
sync-uv-lock:
20+
# runs-on: ubuntu-latest
21+
runs-on: linux.g5.4xlarge.nvidia.gpu
22+
container:
23+
image: pytorch/manylinux2_28-builder:cuda13.0
24+
options: --gpus all
25+
env:
26+
CUDA_VERSION: 13.0
27+
CUDA_HOME: /usr/local/cuda
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
token: ${{ secrets.UV_LOCK_PR_TOKEN }}
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v3
38+
with:
39+
version: "latest"
40+
41+
- name: Install bazel
42+
run: |
43+
set -euo pipefail
44+
set -x
45+
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64 \
46+
-o bazelisk-linux-amd64 \
47+
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel \
48+
&& chmod +x /usr/local/bin/bazel
49+
bazel --version
50+
51+
- name: UV lock and check for changes
52+
id: check-changes
53+
working-directory: ${{ github.workspace }}
54+
run: |
55+
set -euo pipefail
56+
set -x
57+
git config --global safe.directory "$GITHUB_WORKSPACE"
58+
59+
if ! uv lock; then
60+
echo "Error: Failed to update uv.lock"
61+
exit 1
62+
fi
63+
echo "successfully ran uv lock"
64+
if git diff --quiet uv.lock; then
65+
echo "No changes to uv.lock"
66+
exit 0
67+
fi
68+
echo "has_changes=true" >> "$GITHUB_OUTPUT"
69+
echo "there is changes to the uv.lock file"
70+
71+
- name: Create Pull Request
72+
if: steps.check-changes.outputs.has_changes == 'true'
73+
uses: peter-evans/create-pull-request@v5
74+
with:
75+
token: ${{ secrets.UV_LOCK_PR_TOKEN }}
76+
commit-message: "chore: update uv.lock"
77+
base: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
78+
title: "uv.lock file updates"
79+
body: |
80+
## Summary
81+
Automated update of UV lockfiles to ensure all dependencies are current.
82+
83+
### Changes include:
84+
- Updated dependency versions in `uv.lock`
85+
86+
### Next Steps:
87+
- Review the updated dependencies
88+
- Run CI to ensure no breaking changes
89+
- Merge if all tests pass
90+
91+
---
92+
93+
*Auto-generated by [uv-update](.github/workflows/uv-update.yml) workflow*
94+
branch: "update/uv-lockfiles-${{ github.run_id }}"
95+
delete-branch: true
96+
assignees: ""
97+
reviewers: ""
98+
draft: false
99+
100+
concurrency:
101+
group: ${{ github.workflow }}-uv-update-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event_name == 'workflow_dispatch' }}
102+
cancel-in-progress: true

0 commit comments

Comments
 (0)