mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-09-21 11:27:06 +00:00
add support for SETUP_UV_SAVE_CACHE
This commit is contained in:
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
@ -561,6 +561,42 @@ jobs:
|
||||
env:
|
||||
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
||||
|
||||
test-setup-cache-save-cache-env:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup with cache
|
||||
uses: ./
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-env
|
||||
- run: uv sync
|
||||
working-directory: __tests__/fixtures/uv-project
|
||||
shell: bash
|
||||
- run: echo "SETUP_UV_SAVE_CACHE=false" >> $GITHUB_ENV
|
||||
test-restore-cache-save-cache-env:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-setup-cache-save-cache-env
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Restore with cache
|
||||
id: restore
|
||||
uses: ./
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-env
|
||||
- name: Cache was not hit
|
||||
run: |
|
||||
if [ "$CACHE_HIT" == "true" ]; then
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
|
||||
|
||||
test-setup-cache-restore-cache-false:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -823,6 +859,8 @@ jobs:
|
||||
- test-restore-cache-save-cache-false
|
||||
- test-setup-cache-restore-cache-false
|
||||
- test-restore-cache-restore-cache-false
|
||||
- test-setup-cache-save-cache-env
|
||||
- test-restore-cache-save-cache-env
|
||||
- test-setup-cache-local
|
||||
- test-restore-cache-local
|
||||
- test-tilde-expansion-cache-local-path
|
||||
|
Reference in New Issue
Block a user