chore: ci
This commit is contained in:
1 parent
06635898d0
commit
f5f128620a
2 files changed
-52
No files matched your search
@@ -44,6 +44,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Ruff format check
|
- name: Ruff format check
|
||||||
run: ruff format --check . --exclude .venv --exclude venv
|
run: ruff format --check . --exclude .venv --exclude venv
|
||||||
|
|
||||||
- name: Ruff lint
|
|
||||||
run: ruff check . --exclude .venv --exclude venv
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
name: Ruff
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- dev
|
|
||||||
paths:
|
|
||||||
- 'backend/**'
|
|
||||||
- 'pyproject.toml'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- dev
|
|
||||||
paths:
|
|
||||||
- 'backend/**'
|
|
||||||
- 'pyproject.toml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ruff:
|
|
||||||
name: 'Lint & Format Backend'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get changed Python files
|
|
||||||
id: changed
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
||||||
BASE=${{ github.event.pull_request.base.sha }}
|
|
||||||
else
|
|
||||||
BASE=${{ github.event.before }}
|
|
||||||
fi
|
|
||||||
FILES=$(git diff --name-only --diff-filter=ACMR "$BASE" HEAD -- 'backend/**.py' | xargs)
|
|
||||||
echo "files=$FILES" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Ruff check
|
|
||||||
if: steps.changed.outputs.files != ''
|
|
||||||
uses: astral-sh/ruff-action@v3
|
|
||||||
with:
|
|
||||||
args: check ${{ steps.changed.outputs.files }}
|
|
||||||
|
|
||||||
- name: Ruff format
|
|
||||||
if: steps.changed.outputs.files != ''
|
|
||||||
uses: astral-sh/ruff-action@v3
|
|
||||||
with:
|
|
||||||
args: format --check ${{ steps.changed.outputs.files }}
|
|
||||||
Reference in new issue
Block a user