From f91a7008938bd4fef38fabf4a0035b296258c3f5 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 13 Nov 2024 10:49:08 -0300 Subject: [PATCH] ci: Limit workflows to Python files and optimize environment setup (#4567) * Limit style check workflow to Python files only * refactor: update autofix workflow to target Python files and optimize environment setup --- .github/workflows/py_autofix.yml | 13 +++++++------ .github/workflows/style-check-py.yml | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/py_autofix.yml b/.github/workflows/py_autofix.yml index 4786fa527..db901491b 100644 --- a/.github/workflows/py_autofix.yml +++ b/.github/workflows/py_autofix.yml @@ -2,9 +2,7 @@ name: autofix.ci on: pull_request: paths: - - "poetry.lock" - - "pyproject.toml" - - "src/backend/**" + - "**/*.py" env: POETRY_VERSION: "1.8.2" @@ -14,7 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: install-pinned/ruff@9ebc31a5721a0fb034f915e4bbcb2ee6feeaecbc - - run: ruff check --fix-only . - - run: ruff format . + - name: "Setup Environment" + uses: ./.github/actions/setup-uv + - run: uv run ruff check --fix-only . + - run: uv run ruff format . - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.github/workflows/style-check-py.yml b/.github/workflows/style-check-py.yml index 22cdd869a..25abc5e43 100644 --- a/.github/workflows/style-check-py.yml +++ b/.github/workflows/style-check-py.yml @@ -3,6 +3,8 @@ name: Ruff Style Check on: pull_request: types: [opened, synchronize, reopened, auto_merge_enabled] + paths: + - "**/*.py"