SanyamSuyal opened a new pull request, #2745:
URL: https://github.com/apache/fory/pull/2745
### Problem
Fixes #2742
Python CI downloads Bazel binary on every run, which:
- Takes 2-5 seconds per run
- Can fail due to transient network errors
- Wastes bandwidth and CI resources
### Solution
Implemented GitHub Actions caching for Bazel binary to avoid repeated
downloads.
### Changes
- `.github/workflows/ci.yml`: Added actions/cache@v4 step to cache Bazel
binary
- Caches ~/bin/bazel and ~/.local/bin/bazel
- Cache key includes OS, architecture, and Bazel version hash
- Invalidates cache when Bazel version changes
- `ci/tasks/common.py`: Updated install_bazel() function
- Checks if cached Bazel binary exists before downloading
- Verifies cached binary works by running bazel --version
- Automatically re-downloads if cached binary is corrupted
- Skips download entirely when cache is valid
### Testing
Tested all scenarios:
- Fresh install (no cache) - downloads successfully
- Cache hit (valid binary) - skips download, saves time
- Corrupted cache - detects corruption and recovers automatically
- All Python syntax and YAML validation passed
### Benefits
- Faster builds: Saves 2-5 seconds per CI run when cache hits
- More reliable: Reduces dependency on network availability
- Cost savings: Less bandwidth usage and shorter CI runtime
### Related
Follow-up to #2733 (retry logic for Bazel downloads)
Fixes #2742
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]