Skip to content

Commit

Permalink
ci: Try speeding up CI again by enabling uv cache
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 12, 2024
1 parent f7bb993 commit 7dd1d31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ jobs:
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- uses: actions/cache@v3
name: Cache/restore pip data
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
path: ~/.cache/pip
key: pip
enable-cache: true
# Just to give a glob.
# Lets us invalidate the cache with dummy changes to this file.
cache-dependency-glob: requirements.txt

- name: Install Python dependencies
run: pip install -r requirements.txt
run: uv venv && uv pip install -r requirements.txt

- name: Cache/restore Playwright browsers
uses: actions/cache@v3
Expand All @@ -37,7 +39,7 @@ jobs:
run: shot-scraper install

- name: Build everything
run: python build.py
run: .venv/bin/python build.py

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def install_deps(theme: Theme) -> None:
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
env={"VIRTUAL_ENV": str(venv_dir)},
env={"VIRTUAL_ENV": str(venv_dir), "UV_PROJECT_ENVIRONMENT": str(venv_dir)},
)


Expand Down

0 comments on commit 7dd1d31

Please sign in to comment.