Skip to content

Commit

Permalink
ci: use setup-uv action (#846)
Browse files Browse the repository at this point in the history
* ci: use `setup-uv` action

* chore(deps): bump `uv` to 0.4.9
  • Loading branch information
mkniewallner authored Sep 11, 2024
1 parent 04bd36e commit 45a9891
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 43 deletions.
30 changes: 0 additions & 30 deletions .github/actions/setup-python-env/action.yml

This file was deleted.

48 changes: 40 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
PYTHON_VERSION: '3.12'
# renovate: datasource=pypi depName=uv
UV_VERSION: '0.4.9'

jobs:
quality:
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: ${{ env.UV_VERSION }}

- name: Install Python
uses: actions/setup-python@v5
with:
build-project: 'true'
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python dependencies
run: uv sync --frozen --no-install-project

- name: Setup Rust toolchain
run: rustup component add clippy rustfmt
Expand Down Expand Up @@ -52,11 +65,20 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: ${{ env.UV_VERSION }}
enable-cache: 'true'
cache-suffix: ${{ matrix.python-version }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
build-project: 'true'

- name: Install Python dependencies
run: uv sync --frozen

- name: Check typing
run: uv run mypy
Expand All @@ -80,8 +102,18 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: ${{ env.UV_VERSION }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python dependencies
run: uv sync --frozen --no-install-project

- name: Check if documentation can be built
# `--no-project` is a workaround to avoid the installation of deptry
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
types: [published]
workflow_dispatch:

env:
PYTHON_VERSION: '3.12'
# renovate: datasource=pypi depName=uv
UV_VERSION: '0.4.9'

jobs:
set-version:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -45,7 +50,8 @@ jobs:
with:
name: pyproject-toml

- uses: actions/setup-python@v5
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down Expand Up @@ -83,7 +89,8 @@ jobs:
with:
name: pyproject-toml

- uses: actions/setup-python@v5
- name: Install Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -117,7 +124,8 @@ jobs:
with:
name: pyproject-toml

- uses: actions/setup-python@v5
- name: Install Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -182,8 +190,18 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: ${{ env.UV_VERSION }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python dependencies
run: uv sync --frozen --no-install-project

- name: Deploy documentation
# `--no-project` is a workaround to avoid the installation of deptry
Expand Down

0 comments on commit 45a9891

Please sign in to comment.