Skip to content

Commit

Permalink
ci: use cached uv in release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinfall committed Feb 2, 2025
1 parent eab5ce9 commit 99c173f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 34 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,25 @@ jobs:
matrix:
python-version: ["3.13"]
steps:
- name: checkout repo
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: setup Python with uv
id: setup-uv
uses: astral-sh/setup-uv@v5
with:
version: latest
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false # do not remove pre-built wheels
ignore-nothing-to-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: get site-packages path
id: site_packages
run: echo "site_dir=$(python -c 'import site; print(site.getsitepackages()[0])')" > "$GITHUB_OUTPUT"

- name: cache installed packages
uses: actions/cache@v4
with:
path: ${{ steps.site_packages.outputs.site_dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: hint on cache hit
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Hit cache"

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install .
run: uv pip install .

- name: build my custom calendar
run: make run
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,25 @@ jobs:
matrix:
python-version: ["3.13"]
steps:
- name: checkout repo
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: setup Python with uv
id: setup-uv
uses: astral-sh/setup-uv@v5
with:
version: latest
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false # do not remove pre-built wheels
ignore-nothing-to-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: get site-packages path
id: site_packages
run: echo "site_dir=$(python -c 'import site; print(site.getsitepackages()[0])')" > "$GITHUB_OUTPUT"

- name: cache installed packages
uses: actions/cache@v4
with:
path: ${{ steps.site_packages.outputs.site_dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: hint on cache hit
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Hit cache"

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install .
run: uv pip install .

- name: build VNDB calendar with en & ja releases
run: make en
Expand Down

0 comments on commit 99c173f

Please sign in to comment.