Skip to content

Commit

Permalink
Linting and formatting as seperate actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Oct 29, 2023
1 parent 3d8259f commit e2022ba
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Free up disk space
run: |
Expand All @@ -31,21 +31,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e '.[test]'
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Lint the code
run: |
ruff check .
- name: Format the code
run: |
ruff format .
- name: Install ffmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
sudo apt-get install -y ffmpeg
- name: Find and run pytest tests
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code formatting

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Format the code
run: |
ruff format .
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code linting

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint the code
run: |
ruff check .

0 comments on commit e2022ba

Please sign in to comment.