2022-08-26 09:34:58 -06:00
|
|
|
name: Run code quality checks
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2022-09-01 08:14:53 -06:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-08-26 09:34:58 -06:00
|
|
|
jobs:
|
|
|
|
check_code_quality:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.7"
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[quality]
|
|
|
|
- name: Check quality
|
|
|
|
run: |
|
|
|
|
black --check --preview examples tests src utils scripts
|
|
|
|
isort --check-only examples tests src utils scripts
|
|
|
|
flake8 examples tests src utils scripts
|
|
|
|
doc-builder style src/diffusers docs/source --max_len 119 --check_only --path_to_docs docs/source
|