-
Notifications
You must be signed in to change notification settings - Fork 0
feature: cache installed dependancies to speed up build time #11
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -20,19 +20,27 @@ jobs: | |
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.14" | ||
| cache: 'pip' | ||
|
|
||
| - name: Cache pip dependencies | ||
| - name: Cache full virtual environment | ||
| uses: actions/cache@v4 | ||
| id: cache-venv | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'requirements*.txt') }} | ||
| path: .venv | ||
| key: ${{ runner.os }}-py3.14-venv-${{ hashFiles('pyproject.toml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip- | ||
| ${{ runner.os }}-py3.14-venv- | ||
|
|
||
|
Comment on lines
20
to
33
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. 🧩 Analysis chain🏁 Script executed: # First, check if the file exists and examine lines 20-33
if [ -f .github/workflows/docker-publish.yml ]; then
echo "=== docker-publish.yml lines 20-33 ==="
sed -n '20,33p' .github/workflows/docker-publish.yml
echo ""
echo "=== Full file for context ==="
cat -n .github/workflows/docker-publish.yml
else
echo "File not found: .github/workflows/docker-publish.yml"
fiRepository: varit05/Streaming-Video-RAG Length of output: 3787 🏁 Script executed: # Check if ci.yml exists and has similar caching patterns
if [ -f .github/workflows/ci.yml ]; then
echo "=== Searching for cache patterns in ci.yml ==="
grep -n "cache.*py3\|restore-keys\|.venv" .github/workflows/ci.yml || echo "No matches found"
else
echo "ci.yml not found"
fiRepository: varit05/Streaming-Video-RAG Length of output: 525 🌐 Web query:
💡 Result: The actions/setup-python action (including v5) exposes an output named Citations:
Harden The cache key on line 30 hardcodes Use the dynamic The same issue exists in 🤖 Prompt for AI Agents |
||
| - name: Install dependencies | ||
| if: steps.cache-venv.outputs.cache-hit != 'true' | ||
| run: | | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
| python -m pip install --upgrade pip | ||
| pip install ".[dev]" | ||
| pip install --no-cache-dir ".[dev]" | ||
|
|
||
| - name: Activate virtual environment | ||
| run: echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Run Ruff linter | ||
| run: ruff check . | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ dependencies = [ | |
|
|
||
| # RAG | ||
| "tiktoken>=0.7", | ||
| "nltk>=3.8.1", | ||
|
|
||
| # Storage | ||
| "sqlalchemy>=2.0", | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: varit05/Streaming-Video-RAG
Length of output: 859
🏁 Script executed:
Repository: varit05/Streaming-Video-RAG
Length of output: 560
🌐 Web query:
actions/setup-python@v5 outputs python-version💡 Result:
The
actions/setup-python@v5action provides apython-versionoutput that returns the precise installed Python (or PyPy/GraalPy) version as a string, particularly useful when thepython-versioninput is a range (e.g., "3.9.0 - 3.12.0" resolves to e.g. "3.12.0") [1][2]. Other outputs includepython-path(absolute path to the executable) andcache-hit(boolean for cache restoration) [1][2]. Example usage:- uses: actions/setup-python@v5 id: python-setup with: python-version: '3.x' - run: echo "Python version: ${{ steps.python-setup.outputs.python-version }}"This echoes the exact version installed, such as "3.12.3" [1].Citations:
Use dynamic Python version in
.venvcache key to prevent incompatible virtualenv restoration.On lines 35 and 37, the hardcoded
py3.14in the cache key andrestore-keysfallback creates a maintenance burden and can restore incompatible virtualenv caches if the Python version changes. Usesteps.setup-python.outputs.python-versioninstead, which is provided byactions/setup-python@v5and contains the exact installed version.Additionally, adding
id: setup-pythonto the setup-python step (line 25) is required to access its outputs.Suggested patch
- name: Set up Python uses: actions/setup-python@v5 + id: setup-python with: python-version: "3.14" cache: 'pip' @@ - name: Cache full virtual environment uses: actions/cache@v4 id: cache-venv with: path: .venv - key: ${{ runner.os }}-py3.14-venv-${{ hashFiles('pyproject.toml') }} + key: ${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-venv-${{ hashFiles('pyproject.toml') }} restore-keys: | - ${{ runner.os }}-py3.14-venv- + ${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-venv-🤖 Prompt for AI Agents