Skip to content

ci: cache uv binary in tool-cache to skip GitHub Releases download#30

Closed
trisdoan wants to merge 2 commits intomainfrom
fix/ci-uv-caching
Closed

ci: cache uv binary in tool-cache to skip GitHub Releases download#30
trisdoan wants to merge 2 commits intomainfrom
fix/ci-uv-caching

Conversation

@trisdoan
Copy link
Copy Markdown
Collaborator

@trisdoan trisdoan commented Mar 5, 2026

Before

setup-uv with enable-cache: true was already added in #17, caching the uv package cache (~/.cache/uv). However, the uv binary itself was still downloaded from GitHub Releases on every matrix job run, producing this noise in logs:

Trying to find version for uv in: /home/runner/work/odoo-venv/odoo-venv/uv.toml
Could not find file: /home/runner/work/odoo-venv/odoo-venv/uv.toml
Trying to find version for uv in: /home/runner/work/odoo-venv/odoo-venv/pyproject.toml
Could not find file: /home/runner/work/odoo-venv/odoo-venv/pyproject.toml
Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest.
Getting latest version from GitHub API...
manifest-file not provided, reading from local file.
manifest-file does not contain version 0.10.8, arch x86_64, platform unknown-linux-gnu. Falling back to GitHub releases.

This happens because setup-uv runs before checkout — no pyproject.toml exists yet, so it can't resolve the version locally and falls back to a GitHub Releases download every time.

After

An explicit actions/cache step now caches /opt/hostedtoolcache/uv. setup-uv checks this directory first; if the binary is present, it skips the GitHub Releases download and the log noise above disappears on warm runs.

Also incorporates the e2e job split from #18: testtest-native + new test-oca job that runs with OCA modules after test-native succeeds.

Rationale

  • enable-cache: true — caches the uv package cache (pip-equivalent downloads), not the binary
  • ignore-empty-workdir: true — suppresses the "could not find uv.toml/pyproject.toml" warnings; the repo isn't checked out yet at this step
  • Cache key uv-binary-${{ runner.os }}-0.10.8 is static (no branch component) so all PRs read the cache warmed by main
  • Same cache key shared across both test-native and test-oca — native job warms it, OCA job reuses

Supersedes #18

This PR absorbs all changes and adds uv binary caching to both jobs.

trisdoan added 2 commits March 5, 2026 09:21
- Rename test job to test-native and update label to clarify Odoo-only
- Reorder bootstrap steps: git config and curl before config.toml write
- Change --no-newcomer to --yes on all tlc commands for non-interactive CI
- Add test-oca job that runs after test-native to test with OCA modules
- Configure test-oca with uv binary cache (same key as test-native)
- Pin uv version to 0.10.8 in test-oca with ignore-empty-workdir: true
- Exclude master branch from test-oca (no all_repos_master.toml available)
- Set continue-on-error on pull-repos in test-oca for missing branch failures
@trisdoan trisdoan marked this pull request as ready for review March 5, 2026 03:28
@trisdoan trisdoan marked this pull request as draft March 5, 2026 03:47
@nilshamerlinck
Copy link
Copy Markdown
Contributor

nilshamerlinck commented Mar 5, 2026

ah I continued to iterate on #18 to cover more cases
it will take some time to cover them all...
included your changes as ba5ed12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants