Skip to content

Commit

Permalink
Add full uv workflow and caching
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed Dec 2, 2024
1 parent fa7169d commit a580397
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ name: lint

env:
PYTHONUNBUFFERED: "1"
UV_SYSTEM_PYTHON: 1

jobs:
lint-ruff:
Expand All @@ -18,18 +17,14 @@ jobs:
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
uses: astral-sh/setup-uv@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
shell: bash
run: uv python install

- name: Install dependencies
run: uv pip install . ruff
run: uv pip install ruff

- name: Lint with ruff
run: ruff check --output-format=github .
11 changes: 5 additions & 6 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ name: pages

env:
PYTHONUNBUFFERED: "1"
UV_SYSTEM_PYTHON: 1

jobs:
build-sphinx-site:
Expand All @@ -22,16 +21,16 @@ jobs:
uses: actions/configure-pages@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: docs
cache-suffix: pypi
prune-cache: false

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
shell: bash
run: uv python install

- name: Install Python dependencies
run: uv pip install .[docs]
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name: pypi-publish

env:
PYTHONUNBUFFERED: "1"
UV_SYSTEM_PYTHON: 1

jobs:
pypi-publish:
Expand All @@ -23,15 +22,15 @@ jobs:
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
prune-cache: false

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
shell: bash
run: uv python install

- name: Install Python dependencies
run: uv pip install .
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/python-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

name: python-build-and-test

env:
PYTHONUNBUFFERED: "1"

jobs:
build-and-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,8 +41,4 @@ jobs:
- name: Build and test with tox
shell: bash
run: tox r

# https://docs.astral.sh/uv/concepts/cache/#caching-in-continuous-integration
# - name: Minimize uv cache
# run: uv cache prune --ci
run: tox r -vv

0 comments on commit a580397

Please sign in to comment.