Skip to content

Commit daf2f06

Browse files
committed
Revert "Revert "Remove skipping logic in favor of path filtering (#14170)" (#14244)"
This reverts commit fcf9b42.
1 parent 8a8f9a1 commit daf2f06

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
set -e
@@ -82,7 +81,6 @@ jobs:
8281
PACKAGE_NAME: pytorch
8382
FREEZE_REQUIREMENTS: 1
8483
displayName: 'Install dependencies'
85-
condition: eq(variables['continue'], '1')
8684
8785
- bash: |
8886
set -e
@@ -91,24 +89,20 @@ jobs:
9189
python requirements/pytorch/check-avail-strategies.py
9290
python requirements/pytorch/check-avail-extras.py
9391
displayName: 'Env details'
94-
condition: eq(variables['continue'], '1')
9592
9693
- bash: bash .actions/pull_legacy_checkpoints.sh
9794
displayName: 'Get legacy checkpoints'
98-
condition: eq(variables['continue'], '1')
9995

10096
- bash: python -m coverage run --source pytorch_lightning -m pytest
10197
workingDirectory: src/pytorch_lightning
10298
displayName: 'Testing: PyTorch doctests'
103-
condition: eq(variables['continue'], '1')
10499

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

113107
- bash: bash run_standalone_tests.sh
114108
workingDirectory: tests/tests_pytorch
@@ -117,7 +111,14 @@ jobs:
117111
PL_RUN_CUDA_TESTS: "1"
118112
displayName: 'Testing: PyTorch standalone tests'
119113
timeoutInMinutes: "35"
120-
condition: eq(variables['continue'], '1')
114+
115+
- bash: bash run_standalone_tasks.sh
116+
workingDirectory: tests/tests_pytorch
117+
env:
118+
PL_USE_MOCKED_MNIST: "1"
119+
PL_RUN_CUDA_TESTS: "1"
120+
displayName: 'Testing: PyTorch standalone tasks'
121+
timeoutInMinutes: "10"
121122

122123
- bash: |
123124
python -m coverage report
@@ -127,14 +128,13 @@ jobs:
127128
ls -l
128129
workingDirectory: tests/tests_pytorch
129130
displayName: 'Statistics'
130-
condition: eq(variables['continue'], '1')
131131
132132
- task: PublishTestResults@2
133133
displayName: 'Publish test results'
134134
inputs:
135135
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
136136
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
137-
condition: and(succeededOrFailed(), eq(variables['continue'], '1'))
137+
condition: succeededOrFailed()
138138

139139
- script: |
140140
set -e
@@ -146,11 +146,9 @@ jobs:
146146
env:
147147
PL_USE_MOCKED_MNIST: "1"
148148
displayName: 'Testing: PyTorch examples'
149-
condition: eq(variables['continue'], '1')
150149
151150
- bash: python -m pytest benchmarks -v --maxfail=2 --durations=0
152151
workingDirectory: tests/tests_pytorch
153152
env:
154153
PL_RUN_CUDA_TESTS: "1"
155154
displayName: 'Testing: PyTorch benchmarks'
156-
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 }}
@@ -35,28 +41,7 @@ jobs:
3541

3642
- uses: actions/checkout@v2
3743

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

7257
- name: DocTests
73-
if: ${{ (steps.skip.outputs.continue == '1') }}
7458
working-directory: ./src
7559
run: pytest pytorch_lightning --cov=pytorch_lightning
7660

7761
- name: Update all dependencies
78-
if: ${{ (steps.skip.outputs.continue == '1') }}
7962
env:
8063
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
8164
HOROVOD_WITHOUT_MXNET: 1
@@ -95,11 +78,9 @@ jobs:
9578
python requirements/pytorch/check-avail-extras.py
9679
9780
- name: Pull legacy checkpoints
98-
if: ${{ (steps.skip.outputs.continue == '1') }}
9981
run: bash .actions/pull_legacy_checkpoints.sh
10082

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

@@ -111,15 +92,15 @@ jobs:
11192
if: failure()
11293

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

0 commit comments

Comments
 (0)