From 8fe597ce70fa4a68bafa6d8988e747f12f017143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Doma=C5=84ski?= Date: Wed, 15 Apr 2026 17:24:27 +0200 Subject: [PATCH] [workflow] bump --- .github/workflows/python.yml | 64 ++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b160095..23001f3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,36 +1,44 @@ -name: Python lint and test +name: Python Quality & Tests on: push: - branches: - - main - - 'releases/**' - paths: - - '**.py' + branches: [main, 'releases/**'] + paths: ['**.py'] pull_request: - branches: - - main - - 'releases/**' - paths: - - '**.py' + branches: [main, 'releases/**'] + paths: ['**.py'] + +# Automatically cancel older runs of the same PR/branch if a new commit is pushed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - linttest: - runs-on: ubuntu-22.04 + quality: + name: Lint, Typecheck, and Test + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install uv (Fastest Python Tooling) + uses: astral-sh/setup-uv@v3 with: - python-version: '3.12' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements_local.txt - - name: Run black - run: black --check fooder - - name: Run flake8 - run: flake8 fooder - - name: Run mypy - run: mypy fooder - - name: Run tests - run: ./test.sh + enable-cache: true + + - name: Set up Python + run: uv python install 3.14 + + - name: Install Dependencies + run: uv pip install -r requirements/local.txt + + - name: Lint and Format (Ruff) + # Replaces Black and Flake8 in one go + run: uv run ruff check fooder && uv run ruff format --check fooder + + - name: Type Check (Mypy) + run: uv run mypy fooder + + - name: Run Tests + run: chmod +x ./test.sh && ./test.sh