Skip to content

Commit fa9bc02

Browse files
authored
[Tests] make test steps dependent on certain things and general cleanup of the workflows (huggingface#7026)
make tests conditional and other things.
1 parent 2e31a75 commit fa9bc02

9 files changed

+103
-50
lines changed

.github/workflows/pr_dependency_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
79
push:
810
branches:
911
- main

.github/workflows/pr_flax_dependency_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
79
push:
810
branches:
911
- main

.github/workflows/pr_quality.yml

-49
This file was deleted.

.github/workflows/pr_test_peft_backend.yml

+40
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "tests/**.py"
710

811
concurrency:
912
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -16,7 +19,44 @@ env:
1619
PYTEST_TIMEOUT: 60
1720

1821
jobs:
22+
check_code_quality:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.8"
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install .[quality]
34+
- name: Check quality
35+
run: |
36+
ruff check examples tests src utils scripts
37+
ruff format examples tests src utils scripts --check
38+
39+
check_repository_consistency:
40+
needs: check_code_quality
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- name: Set up Python
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: "3.8"
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install .[quality]
52+
- name: Check quality
53+
run: |
54+
python utils/check_copies.py
55+
python utils/check_dummies.py
56+
make deps_table_check_updated
57+
1958
run_fast_tests:
59+
needs: [check_code_quality, check_repository_consistency]
2060
strategy:
2161
fail-fast: false
2262
matrix:

.github/workflows/pr_tests.yml

+46
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "benchmarks/**.py"
10+
- "examples/**.py"
11+
- "scripts/**.py"
12+
- "tests/**.py"
13+
- ".github/**.yml"
14+
- "utils/**.py"
715
push:
816
branches:
917
- ci-*
@@ -19,7 +27,44 @@ env:
1927
PYTEST_TIMEOUT: 60
2028

2129
jobs:
30+
check_code_quality:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up Python
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: "3.8"
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install .[quality]
42+
- name: Check quality
43+
run: |
44+
ruff check examples tests src utils scripts
45+
ruff format examples tests src utils scripts --check
46+
47+
check_repository_consistency:
48+
needs: check_code_quality
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: Set up Python
53+
uses: actions/setup-python@v4
54+
with:
55+
python-version: "3.8"
56+
- name: Install dependencies
57+
run: |
58+
python -m pip install --upgrade pip
59+
pip install .[quality]
60+
- name: Check quality
61+
run: |
62+
python utils/check_copies.py
63+
python utils/check_dummies.py
64+
make deps_table_check_updated
65+
2266
run_fast_tests:
67+
needs: [check_code_quality, check_repository_consistency]
2368
strategy:
2469
fail-fast: false
2570
matrix:
@@ -117,6 +162,7 @@ jobs:
117162
path: reports
118163

119164
run_staging_tests:
165+
needs: [check_code_quality, check_repository_consistency]
120166
strategy:
121167
fail-fast: false
122168
matrix:

.github/workflows/pr_torch_dependency_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
79
push:
810
branches:
911
- main

.github/workflows/push_tests.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ on:
44
push:
55
branches:
66
- main
7-
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "examples/**.py"
10+
- "tests/**.py"
811

912
env:
1013
DIFFUSERS_IS_CI: yes

.github/workflows/push_tests_fast.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "examples/**.py"
10+
- "tests/**.py"
711

812
concurrency:
913
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/push_tests_mps.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "tests/**.py"
710

811
env:
912
DIFFUSERS_IS_CI: yes

0 commit comments

Comments
 (0)