Skip to content

Commit

Permalink
refactor: pytest and ruff workflows
Browse files Browse the repository at this point in the history
only run pytest/ruff checks when python file has changed
  • Loading branch information
kraanzu committed Nov 11, 2024
1 parent 2044b34 commit 592b3e3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ on:
push:
branches:
- develop
paths:
- '**/*.py'
pull_request:
branches:
- main
- develop
paths:
- '**/*.py'

jobs:
test:
Expand Down
43 changes: 27 additions & 16 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: Ruff Checks (lint/format)

on: [push, pull_request]
on:
push:
branches:
- develop
paths:
- '**/*.py'
pull_request:
branches:
- main
- develop
paths:
- '**/*.py'

jobs:
lint:
Expand All @@ -9,18 +20,18 @@ jobs:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint Check
run: |
ruff check .
- name: Format Check
run: |
ruff format --check .
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint Check
run: |
ruff check .
- name: Format Check
run: |
ruff format --check .

0 comments on commit 592b3e3

Please sign in to comment.