mirror of
https://github.com/RfidResearchGroup/ChameleonUltra.git
synced 2026-09-11 18:30:14 -07:00
Merge pull request #429 from RfidResearchGroup/split-python-linter
feat: split linter and formatting check
This commit is contained in:
@@ -8,7 +8,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
lint-formatting:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
@@ -42,14 +42,53 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
# Try project requirements if present
|
||||
if [ -f script/requirements.txt ]; then pip install -r script/requirements.txt || true; fi
|
||||
# Ensure ruff and pyrefly are available
|
||||
pip install ruff pyrefly
|
||||
# Ensure ruff is available
|
||||
pip install ruff
|
||||
|
||||
- name: Ruff check
|
||||
run: |
|
||||
set -e
|
||||
(uv run ruff --version && uv run ruff check .) || ruff check .
|
||||
|
||||
lint-types:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: software
|
||||
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
cache: "pip"
|
||||
cache-dependency-path: |
|
||||
software/pyproject.toml
|
||||
software/uv.lock
|
||||
software/script/requirements.txt
|
||||
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
- name: Install dependencies with uv (if lockfile present)
|
||||
if: ${{ hashFiles('software/uv.lock') != '' }}
|
||||
run: uv sync --dev
|
||||
|
||||
- name: Install tools with pip (fallback)
|
||||
if: ${{ hashFiles('software/uv.lock') == '' }}
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
# Try project requirements if present
|
||||
if [ -f script/requirements.txt ]; then pip install -r script/requirements.txt || true; fi
|
||||
# Ensure pyrefly is available
|
||||
pip install pyrefly
|
||||
|
||||
- name: Pyrefly check
|
||||
run: |
|
||||
set -e
|
||||
|
||||
Reference in New Issue
Block a user