Add Python install cache restore test

This commit is contained in:
merlinz01 2025-10-09 16:14:46 -04:00
parent a61896fc1e
commit 08df9dc1e9

View file

@ -847,6 +847,7 @@ jobs:
with:
enable-cache: true
cache-python: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-python-installs
- run: uv sync --verbose
working-directory: __tests__/fixtures/uv-project-pinned-python
- name: Verify the correct Python version is installed
@ -864,12 +865,29 @@ jobs:
echo "Python install dir should exist"
exit 1
fi
- name: Verify Python is installed in install dir
test-restore-python-installs:
runs-on: ubuntu-latest
needs: test-cache-python-installs
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Restore with cache
id: restore
uses: ./
with:
enable-cache: true
cache-python: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-python-installs
- name: Cache was hit
run: |
if [ ! -f ~/.local/share/uv/python/cpython-3.13.3-linux-x86_64-gnu/bin/python3.13 ]; then
echo "Python binary does not exist"
if [ "$CACHE_HIT" != "true" ]; then
exit 1
fi
env:
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
- run: uv sync
working-directory: __tests__/fixtures/uv-project-pinned-python
all-tests-passed:
runs-on: ubuntu-latest
@ -913,6 +931,8 @@ jobs:
- test-relative-path
- test-cache-prune-force
- test-cache-dir-from-file
- test-cache-python-installs
- test-restore-python-installs
if: always()
steps:
- name: All tests passed