From 4a47702caeafb47a4717b53f6fdd508af1d342f9 Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 3 May 2026 18:31:59 +0200 Subject: [PATCH] ci: use actions/setup-uv --- .github/workflows/{lint.yml => python.yml} | 42 ++++++++++++---------- README.md | 2 +- 2 files changed, 24 insertions(+), 20 deletions(-) rename .github/workflows/{lint.yml => python.yml} (51%) diff --git a/.github/workflows/lint.yml b/.github/workflows/python.yml similarity index 51% rename from .github/workflows/lint.yml rename to .github/workflows/python.yml index 6b1b9c9..d1c7406 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/python.yml @@ -4,7 +4,15 @@ concurrency: group: python-${{ github.ref }} cancel-in-progress: true -on: [push, workflow_dispatch] +on: + workflow_dispatch: + push: + paths: + - '.github/workflows/python.yml' + - 'pyproject.toml' + - 'uv.lock' + - '.python-version' + - '**/*.py' jobs: ruff: @@ -12,47 +20,43 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Set up UV + uses: actions/setup-uv@v1 - name: Run Ruff check - uses: https://github.com/astral-sh/ruff-action@v3 - with: - args: "check" + run: uv run ruff check --output-format=github ruff-format-check: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v5 + - name: Set up UV + uses: actions/setup-uv@v1 - name: Run Ruff format check - uses: https://github.com/astral-sh/ruff-action@v3 - with: - args: "format --check --diff" + run: uv run ruff format --check --output-format=github ty: runs-on: ubuntu-latest steps: - - name: Install UV - run: python3 -m pip install uv --break-system-packages - name: Checkout repository uses: actions/checkout@v5 - - name: Sync Python dependencies - run: python3 -m uv sync + - name: Set up UV + uses: actions/setup-uv@v1 - name: Run ty check - run: python3 -m uv run ty check --output-format github + run: uv run ty check --output-format=github coverage: runs-on: ubuntu-latest steps: - - name: Install UV - run: python3 -m pip install uv --break-system-packages - name: Checkout repository uses: actions/checkout@v5 - - name: Sync Python dependencies - run: python3 -m uv sync + - name: Set up UV + uses: actions/setup-uv@v1 - 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 - run: python3 -m uv run coverage xml + run: uv run coverage xml - name: Create coverage summary - uses: https://github.com/irongut/CodeCoverageSummary@v1.3.0 + uses: actions/code-coverage-summary@v1.3.0 with: filename: coverage.xml diff --git a/README.md b/README.md index 5cffd35..67021f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![](https://git.klemek.fr/klemek/stapler/actions/workflows/lint.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/stapler/actions?workflow=lint.yml) [![](https://git.klemek.fr/klemek/stapler/actions/workflows/docker.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/stapler/actions?workflow=docker.yml) +[![](https://git.klemek.fr/klemek/stapler/actions/workflows/python.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/stapler/actions?workflow=python.yml) [![](https://git.klemek.fr/klemek/stapler/actions/workflows/docker.yml/badge.svg?branch=main&style=flat-square)](https://git.klemek.fr/klemek/stapler/actions?workflow=docker.yml) # Stapler