Repository navigation
feat(ci): Add tasks for checking and updating UV lock files (uv.lock); Add check to GH workflow.
#1507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): Add tasks for checking and updating UV lock files (uv.lock); Add check to GH workflow.
#1507
Changes from 10 commits
79b88a8
cbb8629
03f33a2
212a904
cb57c0e
143058d
47a58d5
dae6cb7
6da77ea
16f34b7
dd13a01
fde9a1a
39417f0
b5dc6ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: "clp-uv-checks" | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: &monitored_paths | ||
| - ".github/workflows/clp-uv-checks.yaml" | ||
| - "components/clp-mcp-server/pyproject.toml" | ||
| - "components/clp-mcp-server/uv.lock" | ||
| - "components/clp-package-utils/pyproject.toml" | ||
| - "components/clp-package-utils/uv.lock" | ||
| - "components/clp-py-utils/pyproject.toml" | ||
| - "components/clp-py-utils/uv.lock" | ||
| - "components/job-orchestration/pyproject.toml" | ||
| - "components/job-orchestration/uv.lock" | ||
| - "integration-tests/pyproject.toml" | ||
| - "integration-tests/uv.lock" | ||
| push: | ||
| paths: *monitored_paths | ||
| schedule: | ||
| # Run daily at 00:15 UTC (the 15 is to avoid periods of high load) | ||
| - cron: "15 0 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: "${{github.workflow}}-${{github.ref}}" | ||
| # Cancel in-progress jobs for efficiency | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| uv-checks: | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - "macos-15" | ||
| - "ubuntu-22.04" | ||
| - "ubuntu-24.04" | ||
| runs-on: "${{matrix.os}}" | ||
| steps: | ||
| - uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: "Install task" | ||
| shell: "bash" | ||
| run: "npm install -g @go-task/cli@3.44.0" | ||
|
|
||
| - name: "Install uv" | ||
| shell: "bash" | ||
| run: "curl --fail --location --silent --show-error https://astral.sh/uv/install.sh | sh" | ||
|
|
||
| - name: "Validate lock files" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow installs uv via the curl script but never appends the installation directory to Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow installs uv via the curl script but never appends the installation directory to Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
the lockfile checks are not in the same "multi-line" command as the "Install uv" step, right? so if a new shell is to be started on every new step, the new step should have had read the shell profile again and get the correct PATH if the uv installation script has correctly set the |
||
| shell: "bash" | ||
| run: "task deps:lock:check-uv" | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -10,12 +10,33 @@ tasks: | |||
| vars: | ||||
| CARGO_FETCH_FLAGS: "--locked" | ||||
|
|
||||
| check-uv: | ||||
| cmds: | ||||
| - for: &uv-projects | ||||
| - "{{.G_COMPONENTS_DIR}}/clp-mcp-server" | ||||
| - "{{.G_COMPONENTS_DIR}}/clp-package-utils" | ||||
| - "{{.G_COMPONENTS_DIR}}/clp-py-utils" | ||||
| - "{{.G_COMPONENTS_DIR}}/job-orchestration" | ||||
| - "{{.G_INTEGRATION_TESTS_DIR}}" | ||||
| task: "uv-lock" | ||||
| vars: | ||||
| PROJECT_DIR: "{{.ITEM}}" | ||||
| UV_LOCK_FLAGS: "--check" | ||||
|
|
||||
| update-rust: | ||||
| cmds: | ||||
| - task: "cargo-workspace-update" | ||||
| vars: | ||||
| CARGO_UPDATE_FLAGS: "" | ||||
|
|
||||
| update-uv: | ||||
| cmds: | ||||
| - for: *uv-projects | ||||
| task: "uv-lock" | ||||
| vars: | ||||
| PROJECT_DIR: "{{.ITEM}}" | ||||
| UV_LOCK_FLAGS: "" | ||||
|
|
||||
| # Runs `cargo fetch` in the root Rust workspace directory with the specified flags. | ||||
| # | ||||
| # @param {string} CARGO_FETCH_FLAGS The flags to pass to the `cargo fetch` command. | ||||
|
|
@@ -41,3 +62,15 @@ tasks: | |||
| cmd: |- | ||||
| . "$HOME/.cargo/env" | ||||
| cargo update {{.CARGO_UPDATE_FLAGS}} | ||||
|
|
||||
| # Runs `uv lock` in the UV project directory with the specified flags. | ||||
| # | ||||
| # @param {string} PROJECT_DIR | ||||
| # @param {string} UV_LOCK_FLAGS The flags to pass to the `uv lock` command. | ||||
| uv-lock: | ||||
| internal: true | ||||
| requires: | ||||
| vars: ["PROJECT_DIR", "UV_LOCK_FLAGS"] | ||||
| dir: "{{.PROJECT_DIR}}" | ||||
| cmd: |- | ||||
| uv lock {{.UV_LOCK_FLAGS}} | ||||
|
Comment on lines
+66
to
+76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider adding clarification on uv tool availability. The task assumes the You may want to verify whether a toolchain dependency (like 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's documented here already: clp/docs/src/dev-docs/building-package.md Line 23 in 2ac456e
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @junhaoliao, thank you for the clarification! You're absolutely right—UV is documented in the building-package guide, and since it's not managed through a task dependency like the rust toolchain, adding that now would indeed be out of scope. I appreciate you pointing out the documentation location and explaining the current approach. ✏️ Learnings added
🧠 Learnings used |
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth to add this to the repo (like how we set up cargo)?
But I guess it's not gonna be in this PR. How about let's try https://github.com/astral-sh/setup-uv?