ci: use actions/setup-uv
This commit is contained in:
@@ -4,7 +4,15 @@ concurrency:
|
|||||||
group: python-${{ github.ref }}
|
group: python-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on: [push, workflow_dispatch]
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/lint.yml'
|
||||||
|
- 'pyproject.toml'
|
||||||
|
- 'uv.lock'
|
||||||
|
- '.python-version'
|
||||||
|
- '**/*.py'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ruff:
|
ruff:
|
||||||
@@ -12,47 +20,43 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
- name: Set up UV
|
||||||
|
uses: actions/setup-uv@v1
|
||||||
- name: Run Ruff check
|
- name: Run Ruff check
|
||||||
uses: https://github.com/astral-sh/ruff-action@v3
|
run: uv run ruff check --output-format=github
|
||||||
with:
|
|
||||||
args: "check"
|
|
||||||
|
|
||||||
ruff-format-check:
|
ruff-format-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
- name: Set up UV
|
||||||
|
uses: actions/setup-uv@v1
|
||||||
- name: Run Ruff format check
|
- name: Run Ruff format check
|
||||||
uses: https://github.com/astral-sh/ruff-action@v3
|
run: uv run ruff format --check --output-format=github
|
||||||
with:
|
|
||||||
args: "format --check --diff"
|
|
||||||
|
|
||||||
ty:
|
ty:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install UV
|
|
||||||
run: python3 -m pip install uv --break-system-packages
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
- name: Sync Python dependencies
|
- name: Set up UV
|
||||||
run: python3 -m uv sync
|
uses: actions/setup-uv@v1
|
||||||
- name: Run ty check
|
- name: Run ty check
|
||||||
run: python3 -m uv run ty check --output-format github
|
run: uv run ty check --output-format=github
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install UV
|
|
||||||
run: python3 -m pip install uv --break-system-packages
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
- name: Sync Python dependencies
|
- name: Set up UV
|
||||||
run: python3 -m uv sync
|
uses: actions/setup-uv@v1
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: python3 -m uv run coverage run -m unittest -v
|
run: uv run coverage run -m unittest -v
|
||||||
- name: Generate coverage XML report
|
- name: Generate coverage XML report
|
||||||
run: python3 -m uv run coverage xml
|
run: uv run coverage xml
|
||||||
- name: Create coverage summary
|
- name: Create coverage summary
|
||||||
uses: https://github.com/irongut/CodeCoverageSummary@v1.3.0
|
uses: actions/code-coverage-summary@v1.3.0
|
||||||
with:
|
with:
|
||||||
filename: coverage.xml
|
filename: coverage.xml
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[](https://git.klemek.fr/klemek/stapler/actions?workflow=lint.yml) [](https://git.klemek.fr/klemek/stapler/actions?workflow=docker.yml)
|
[](https://git.klemek.fr/klemek/stapler/actions?workflow=python.yml) [](https://git.klemek.fr/klemek/stapler/actions?workflow=docker.yml)
|
||||||
|
|
||||||
# Stapler <!-- omit in toc -->
|
# Stapler <!-- omit in toc -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user