@@ -7,6 +7,12 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77 pull_request :
88 branches : [master, "release/*"]
99 types : [opened, reopened, ready_for_review, synchronize]
10+ paths :
11+ - " requirements/pytorch/**"
12+ - " src/pytorch_lightning/**"
13+ - " tests/tests_pytorch/**"
14+ - " setup.cfg" # includes pytest config
15+ - " .github/workflows/ci-pytorch-test-slow.yml"
1016
1117concurrency :
1218 group : ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
@@ -28,43 +34,19 @@ jobs:
2834 steps :
2935 - uses : actions/checkout@v3
3036
31- - name : Get changed files
32- id : changed-files
33- uses :
tj-actions/[email protected] 34-
35- - name : Decide if the test should be skipped
36- id : skip
37- shell : bash -l {0}
38- run : |
39- FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
40- echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr " " "\n" > changed_files.txt
41- MATCHES=$(cat changed_files.txt | grep -E $FILTER)
42- echo $MATCHES
43- if [ -z "$MATCHES" ]; then
44- echo "Skip"
45- echo "::set-output name=continue::0"
46- else
47- echo "Continue"
48- echo "::set-output name=continue::1"
49- fi
50-
5137 - uses : actions/setup-python@v4
52- if : ${{ (steps.skip.outputs.continue == '1') }}
5338 with :
5439 python-version : ${{ matrix.python-version }}
5540
5641 - name : Reset caching
57- if : ${{ (steps.skip.outputs.continue == '1') }}
5842 run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
5943
6044 - name : Get pip cache
61- if : ${{ (steps.skip.outputs.continue == '1') }}
6245 id : pip-cache
6346 run : |
6447 python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
6548
6649 - name : Cache pip
67- if : ${{ (steps.skip.outputs.continue == '1') }}
6850 uses : actions/cache@v3
6951 with :
7052 path : ${{ steps.pip-cache.outputs.dir }}
7355 ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-
7456
7557 - name : Install dependencies
76- if : ${{ (steps.skip.outputs.continue == '1') }}
7758 env :
7859 PACKAGE_NAME : pytorch
7960 FREEZE_REQUIREMENTS : 1
@@ -85,29 +66,28 @@ jobs:
8566 shell : bash
8667
8768 - name : Testing PyTorch
88- if : ${{ (steps.skip.outputs.continue == '1') }}
8969 working-directory : tests/tests_pytorch
9070 run : coverage run --source pytorch_lightning -m pytest -v --junitxml=results-${{ runner.os }}-py${{ matrix.python-version }}.xml
9171 env :
9272 PL_RUN_SLOW_TESTS : 1
9373
9474 - name : Upload pytest test results
95- if : ${{ ( failure()) && (steps.skip.outputs.continue == '1') }}
75+ if : failure()
9676 uses : actions/upload-artifact@v3
9777 with :
9878 name : unittest-results-${{ runner.os }}-py${{ matrix.python-version }}
9979 path : tests/tests_pytorch/results-${{ runner.os }}-py${{ matrix.python-version }}.xml
10080
10181 - name : Statistics
102- if : ${{ ( success()) && (steps.skip.outputs.continue == '1') }}
82+ if : success()
10383 working-directory : tests/tests_pytorch
10484 run : |
10585 coverage report
10686 coverage xml
10787
10888 - name : Upload coverage to Codecov
10989 uses : codecov/codecov-action@v3
110- if : ${{ ( success()) && (steps.skip.outputs.continue == '1') }}
90+ if : success()
11191 # see: https://github.com/actions/toolkit/issues/399
11292 continue-on-error : true
11393 with :
0 commit comments