Skip to content

Commit 1769345

Browse files
carmoccalexierule
authored andcommitted
Remove skipping logic in favor of path filtering (#14170)
(cherry picked from commit fe9e5d5)
1 parent dea58f9 commit 1769345

File tree

8 files changed

+75
-164
lines changed

8 files changed

+75
-164
lines changed

.azure/gpu-tests.yml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,31 @@ trigger:
1212
- "master"
1313
- "release/*"
1414
- "refs/tags/*"
15+
paths:
16+
include:
17+
- ".azure/**"
18+
- "examples/run_ddp_examples.sh"
19+
- "examples/convert_from_pt_to_pl/**"
20+
- "examples/run_pl_examples.sh"
21+
- "examples/pl_basics/backbone_image_classifier.py"
22+
- "examples/pl_basics/autoencoder.py"
23+
- "examples/pl_loops/mnist_lite.py"
24+
- "examples/pl_fault_tolerant/automatic.py"
25+
- "examples/test_pl_examples.py"
26+
- "examples/pl_integrations/dali_image_classifier.py"
27+
- "requirements/pytorch/**"
28+
- "src/pytorch_lightning/**"
29+
- "tests/tests_pytorch/**"
30+
- "setup.cfg"
31+
- "pyproject.toml"
32+
- ".github/workflows/ci-pytorch*.yml"
33+
- ".github/workflows/docs-*.yml"
34+
1535

1636
pr:
1737
- "master"
1838
- "release/*"
1939

20-
variables:
21-
- name: continue
22-
value: '1'
23-
2440
jobs:
2541
- job: testing
2642
strategy:
@@ -41,22 +57,6 @@ jobs:
4157
clean: all
4258

4359
steps:
44-
45-
- bash: |
46-
CHANGED_FILES=$(git diff --name-status origin/master -- . | awk '{print $2}')
47-
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
48-
echo $CHANGED_FILES > changed_files.txt
49-
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
50-
echo $MATCHES
51-
if [ -z "$MATCHES" ]; then
52-
echo "Skip"
53-
echo "##vso[task.setvariable variable=continue]0"
54-
else
55-
echo "Continue"
56-
echo "##vso[task.setvariable variable=continue]1"
57-
fi
58-
displayName: Skipper
59-
6060
- bash: |
6161
lspci | egrep 'VGA|3D'
6262
whereis nvidia
@@ -66,7 +66,6 @@ jobs:
6666
pip --version
6767
pip list
6868
displayName: 'Image info & NVIDIA'
69-
condition: eq(variables['continue'], '1')
7069
7170
- bash: |
7271
python -c "fname = 'requirements/pytorch/strategies.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
@@ -79,7 +78,6 @@ jobs:
7978
PACKAGE_NAME: pytorch
8079
FREEZE_REQUIREMENTS: 1
8180
displayName: 'Install dependencies'
82-
condition: eq(variables['continue'], '1')
8381
8482
- bash: |
8583
set -e
@@ -88,24 +86,20 @@ jobs:
8886
python requirements/pytorch/check-avail-strategies.py
8987
python requirements/pytorch/check-avail-extras.py
9088
displayName: 'Env details'
91-
condition: eq(variables['continue'], '1')
9289
9390
- bash: bash .actions/pull_legacy_checkpoints.sh
9491
displayName: 'Get legacy checkpoints'
95-
condition: eq(variables['continue'], '1')
9692

9793
- bash: python -m coverage run --source pytorch_lightning -m pytest
9894
workingDirectory: src/pytorch_lightning
9995
displayName: 'Testing: PyTorch doctests'
100-
condition: eq(variables['continue'], '1')
10196

10297
- bash: python -m coverage run --source pytorch_lightning -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
10398
env:
10499
PL_RUN_CUDA_TESTS: "1"
105100
workingDirectory: tests/tests_pytorch
106101
displayName: 'Testing: PyTorch standard'
107102
timeoutInMinutes: "35"
108-
condition: eq(variables['continue'], '1')
109103

110104
- bash: bash run_standalone_tests.sh
111105
workingDirectory: tests/tests_pytorch
@@ -114,7 +108,14 @@ jobs:
114108
PL_RUN_CUDA_TESTS: "1"
115109
displayName: 'Testing: PyTorch standalone tests'
116110
timeoutInMinutes: "35"
117-
condition: eq(variables['continue'], '1')
111+
112+
- bash: bash run_standalone_tasks.sh
113+
workingDirectory: tests/tests_pytorch
114+
env:
115+
PL_USE_MOCKED_MNIST: "1"
116+
PL_RUN_CUDA_TESTS: "1"
117+
displayName: 'Testing: PyTorch standalone tasks'
118+
timeoutInMinutes: "10"
118119

119120
- bash: |
120121
python -m coverage report
@@ -124,14 +125,13 @@ jobs:
124125
ls -l
125126
workingDirectory: tests/tests_pytorch
126127
displayName: 'Statistics'
127-
condition: eq(variables['continue'], '1')
128128
129129
- task: PublishTestResults@2
130130
displayName: 'Publish test results'
131131
inputs:
132132
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
133133
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
134-
condition: and(succeededOrFailed(), eq(variables['continue'], '1'))
134+
condition: succeededOrFailed()
135135

136136
- script: |
137137
set -e
@@ -143,11 +143,9 @@ jobs:
143143
env:
144144
PL_USE_MOCKED_MNIST: "1"
145145
displayName: 'Testing: PyTorch examples'
146-
condition: eq(variables['continue'], '1')
147146
148147
- bash: python -m pytest benchmarks -v --maxfail=2 --durations=0
149148
workingDirectory: tests/tests_pytorch
150149
env:
151150
PL_RUN_CUDA_TESTS: "1"
152151
displayName: 'Testing: PyTorch benchmarks'
153-
condition: eq(variables['continue'], '1')

.github/file-filters.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/ci-app_cloud_e2e_test.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,19 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
77
branches: [master, "release/*"]
88
pull_request:
99
branches: [master, "release/*"]
10+
paths:
11+
- ".github/workflows/ci-app-cloud-e2e-test.yml"
12+
- "requirements/app/**"
13+
- "src/lightning_app/**"
14+
- "examples/app_*"
1015

1116
concurrency:
1217
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
1318
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
1419

1520
jobs:
16-
# This is job should once only once per PR to detect file changes so run required jobs.
17-
# see .github/file-filters.yml to define file filters and run the jobs based on the output of each filter.
18-
# More info: https://github.com/marketplace/actions/paths-changes-filter
19-
20-
changes:
21-
runs-on: ubuntu-latest
22-
# Set job outputs to the values from filter step
23-
outputs:
24-
app_examples: ${{ steps.filter.outputs.app_examples }}
25-
steps:
26-
- uses: actions/checkout@v2
27-
- name: Set up Python 3.8
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: "3.8"
31-
32-
- uses: dorny/paths-filter@v2
33-
id: filter
34-
with:
35-
filters: .github/file-filters.yml
36-
3721
cloud-test:
3822
name: Cloud Test
39-
needs: changes
40-
if: ${{ needs.changes.outputs.app_examples == 'true' }}
4123
runs-on: ubuntu-20.04
4224
strategy:
4325
fail-fast: false

.github/workflows/ci-app_examples.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
66
branches: [master, "release/*"]
77
pull_request:
88
branches: [master, "release/*"]
9+
paths:
10+
- ".github/workflows/ci-app-examples.yml"
11+
- "requirements/app/**"
12+
- "src/lightning_app/**"
13+
- "tests/tests_app_examples/**"
14+
# the examples are used in the app CI
15+
- "examples/app_*"
916

1017
concurrency:
1118
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}

.github/workflows/ci-app_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
66
branches: [master, "release/*"]
77
pull_request:
88
paths:
9+
- ".github/workflows/ci-app-tests.yml"
10+
- "requirements/app/**"
911
- "src/lightning_app/**"
1012
- "tests/tests_app/**"
11-
- "requirements/app/**"
12-
- "setup.py"
1313

1414
concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}

.github/workflows/ci-pytorch_test-conda.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
66
branches: [master, "release/*"]
77
pull_request:
88
branches: [master, "release/*"]
9+
paths:
10+
- "requirements/pytorch/**"
11+
- "src/pytorch_lightning/**"
12+
- "tests/tests_pytorch/**"
13+
- "setup.cfg" # includes pytest config
14+
- ".github/workflows/ci-pytorch-test-conda.yml"
915

1016
concurrency:
1117
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
@@ -37,28 +43,7 @@ jobs:
3743

3844
- uses: actions/checkout@v2
3945

40-
- name: Get changed files
41-
id: changed-files
42-
uses: tj-actions/[email protected]
43-
44-
- name: Decide if the test should be skipped
45-
id: skip
46-
shell: bash -l {0}
47-
run: |
48-
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
49-
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr " " "\n" > changed_files.txt
50-
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
51-
echo $MATCHES
52-
if [ -z "$MATCHES" ]; then
53-
echo "Skip"
54-
echo "::set-output name=continue::0"
55-
else
56-
echo "Continue"
57-
echo "::set-output name=continue::1"
58-
fi
59-
6046
- name: Update base dependencies
61-
if: ${{ (steps.skip.outputs.continue == '1') }}
6247
env:
6348
PACKAGE_NAME: pytorch
6449
FREEZE_REQUIREMENTS: 1
@@ -72,12 +57,10 @@ jobs:
7257
run: pip install "Pillow<9.0" # It messes with torchvision
7358

7459
- name: DocTests
75-
if: ${{ (steps.skip.outputs.continue == '1') }}
7660
working-directory: ./src
7761
run: pytest pytorch_lightning --cov=pytorch_lightning
7862

7963
- name: Update all dependencies
80-
if: ${{ (steps.skip.outputs.continue == '1') }}
8164
env:
8265
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
8366
HOROVOD_WITHOUT_MXNET: 1
@@ -97,11 +80,9 @@ jobs:
9780
python requirements/pytorch/check-avail-extras.py
9881
9982
- name: Pull legacy checkpoints
100-
if: ${{ (steps.skip.outputs.continue == '1') }}
10183
run: bash .actions/pull_legacy_checkpoints.sh
10284

10385
- name: Testing PyTorch
104-
if: ${{ (steps.skip.outputs.continue == '1') }}
10586
working-directory: tests/tests_pytorch
10687
run: coverage run --source pytorch_lightning -m pytest -v --timeout 150 --durations=50 --junitxml=results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml
10788

@@ -113,15 +94,15 @@ jobs:
11394
if: failure()
11495

11596
- name: Statistics
116-
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
97+
if: success()
11798
working-directory: tests/tests_pytorch
11899
run: |
119100
coverage report
120101
coverage xml
121102
122103
- name: Upload coverage to Codecov
123104
uses: codecov/codecov-action@v3
124-
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
105+
if: success()
125106
# see: https://github.com/actions/toolkit/issues/399
126107
continue-on-error: true
127108
with:

0 commit comments

Comments
 (0)