Skip to content

Commit

Permalink
chore(ci): use astral-sh/setup-uv action (#10)
Browse files Browse the repository at this point in the history
Generated by the task: njzjz-bot/njzjz-bot#9.

---------

Co-authored-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz-bot and njzjz authored Oct 5, 2024
1 parent 811ade1 commit 9532acb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: |
**/requirements*.txt
**/pyproject.toml
- name: Build dist
run: uv tool run --with build[uv] --from build python -m build --installer uv
- name: Upload release distributions
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:

env:
UV_SYSTEM_PYTHON: 1
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -19,19 +17,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: |
**/requirements*.txt
**/pyproject.toml
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
uv-${{ runner.os }}
- name: Install dependencies
run: uv pip install nox[uv]
- name: Test with pytest
Expand All @@ -40,5 +35,3 @@ jobs:
uses: codecov/codecov-action@v4
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
- name: Minimize uv cache
run: uv cache prune --ci

0 comments on commit 9532acb

Please sign in to comment.