Skip to content

Commit

Permalink
🐛 Update UV Cache github action inputs and cache functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
yezz123 committed Aug 25, 2024
1 parent 6f461b4 commit e5d91ff
Showing 1 changed file with 3 additions and 48 deletions.
51 changes: 3 additions & 48 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
uv-version: ["0.1.12", "0.3.0", ""]
uv-version: ["0.3.0", "latest"]
os: [macos-latest, ubuntu-latest, windows-latest]
cache: [true, false]
fail-fast: true
Expand All @@ -53,6 +53,8 @@ jobs:
which python
- name: Check inside virtual environment
run: python -c "import sys; exit(0 if sys.prefix != sys.base_prefix else 1)"
- name: init Project
run: uv init
- name: Install Pydantic and Ruff
run: |
uv add pydantic ruff
Expand All @@ -71,50 +73,3 @@ jobs:
Get-ChildItem -Force ${{ env.UV_CACHE_DIR || '$env:TEMP\.uv-cache' }}
echo "Checking for Pydantic and Ruff in cache"
Get-ChildItem -Recurse ${{ env.UV_CACHE_DIR || '$env:TEMP\.uv-cache' }} | Where-Object { $_.Name -like "*pydantic*" -or $_.Name -like "*ruff*" }
test-cache-behavior:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Test cache with unsupported version (expected to fail)
uses: ./
with:
uv-version: "0.2.9"
uv-cache: true
continue-on-error: true
- name: Verify failure for unsupported version
run: |
if [ $? -eq 0 ]; then
echo "Action succeeded when it should have failed"
exit 1
fi
- name: Test cache with supported version (expected to fail)
uses: ./
with:
uv-version: "0.3.0"
uv-cache: true
continue-on-error: true
- name: Verify failure for supported version with cache
run: |
if [ $? -eq 0 ]; then
echo "Action succeeded when it should have failed"
exit 1
fi
- name: Test no cache when not requested (expected to succeed)
uses: ./
with:
uv-version: "0.3.0"
uv-cache: false
- name: Verify success for no cache
run: |
if [ $? -ne 0 ]; then
echo "Action failed when it should have succeeded"
exit 1
fi
if [ -d "$UV_CACHE_DIR" ]; then
echo "Cache directory exists when it shouldn't"
exit 1
fi

0 comments on commit e5d91ff

Please sign in to comment.