Skip to content

Commit

Permalink
Pull out black, ruff, mypy to individual CI actions
Browse files Browse the repository at this point in the history
This allows them to run in parallel.

Topic: ci_parallel_actions_linter
  • Loading branch information
hmartiro committed Mar 26, 2023
1 parent 0e6d743 commit 9e785d6
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 30 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Black Format

on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Python Test
run-name: ${{ github.actor }} is running Riffusion CI

on:
Expand All @@ -9,7 +9,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
riffusion-ci:
run:
runs-on: ubuntu-latest

strategy:
Expand All @@ -30,14 +30,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y ffmpeg libsndfile1
- name: Install pip packages from requirements.txt
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install pip packages from dev_requirements.txt
- name: Install pip packages
run: |
pip install -r dev_requirements.txt
pip install -r requirements_all.txt
- name: Test with unittest
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: MyPy Type Check

on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: jpetrucciani/mypy-check@master
with:
mypy_flags: '--config-file pyproject.toml'
requirements_file: 'requirements_all.txt'
15 changes: 15 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Ruff Lint

on:
push:
branches:
- 'main'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jpetrucciani/ruff-check@main
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ ignore_missing_imports = true
module = "diffusers.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "huggingface_hub.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "numpy.*"
ignore_missing_imports = true
Expand Down
2 changes: 2 additions & 0 deletions requirements_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
-r requirements_dev.txt
File renamed without changes.
24 changes: 0 additions & 24 deletions test/linter_test.py

This file was deleted.

0 comments on commit 9e785d6

Please sign in to comment.