1- name : Test PyTorch full
1+ name : Test PyTorch full
22
33# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44on : # Trigger the workflow on push or pull request, but only for the master branch
@@ -7,6 +7,11 @@ 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-ignore :
11+ - " src/lightning_app/**" # todo: implement job skip
12+ - " tests/tests_app/**" # todo: implement job skip
13+ - " tests/tests_app_examples/**" # todo: implement job skip
14+ - " examples/app_*" # todo: implement job skip
1015
1116concurrency :
1217 group : ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
@@ -32,67 +37,40 @@ jobs:
3237
3338 steps :
3439 - uses : actions/checkout@v2
35-
36- - name : Get changed files
37- id : changed-files
38- uses :
tj-actions/[email protected] 39-
40- - name : Decide if the test should be skipped
41- id : skip
42- run : |
43- FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_'
44- echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr " " "\n" > changed_files.txt
45- MATCHES=$(cat changed_files.txt | grep -E $FILTER)
46- echo $MATCHES
47- if [ -z "$MATCHES" ]; then
48- echo "Skip"
49- echo "::set-output name=continue::'0'"
50- else
51- echo "Continue"
52- echo "::set-output name=continue::'1'"
53- fi
54-
5540 - name : Set up Python ${{ matrix.python-version }}
56- if : ${{ (steps.skip.outputs.continue == '1') }}
5741 uses : actions/setup-python@v2
5842 with :
5943 python-version : ${{ matrix.python-version }}
6044
6145 - name : Reset caching
62- if : ${{ (steps.skip.outputs.continue == '1') }}
6346 run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
6447
6548 - name : basic setup
66- if : ${{ (steps.skip.outputs.continue == '1') }}
6749 run : |
6850 pip --version
6951 pip install -q fire
7052
7153 # Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
7254 - name : Setup macOS
73- if : ${{ ( runner.os == 'macOS') && (steps.skip.outputs.continue == '1') }}
55+ if : runner.os == 'macOS'
7456 run : |
7557 brew install openmpi libuv # Horovod on macOS requires OpenMPI, Gloo not currently supported
76-
7758 - name : Setup Windows
78- if : ${{ ( runner.os == 'windows') && (steps.skip.outputs.continue == '1') }}
59+ if : runner.os == 'windows'
7960 run : |
8061 python .actions/assistant.py requirements_prune_pkgs horovod
81-
8262 - name : Set min. dependencies
83- if : ${{ ( matrix.requires == 'oldest') && (steps.skip.outputs.continue == '1') }}
63+ if : matrix.requires == 'oldest'
8464 run : |
8565 python .actions/assistant.py replace_oldest_ver
8666
8767 # Note: This uses an internal pip API and may not always work
8868 # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
8969 - name : Get pip cache dir
90- if : ${{ (steps.skip.outputs.continue == '1') }}
9170 id : pip-cache
9271 run : echo "::set-output name=dir::$(pip cache dir)"
9372
9473 - name : pip cache
95- if : ${{ (steps.skip.outputs.continue == '1') }}
9674 uses : actions/cache@v2
9775 with :
9876 path : ${{ steps.pip-cache.outputs.dir }}
@@ -101,11 +79,9 @@ jobs:
10179 ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
10280
10381 - name : Pull legacy checkpoints
104- if : ${{ (steps.skip.outputs.continue == '1') }}
10582 run : bash .actions/pull_legacy_checkpoints.sh
10683
10784 - name : Install dependencies
108- if : ${{ (steps.skip.outputs.continue == '1') }}
10985 env :
11086 PACKAGE_NAME : pytorch
11187 FREEZE_REQUIREMENTS : 1
@@ -117,12 +93,10 @@ jobs:
11793 shell : bash
11894
11995 - name : DocTests
120- if : ${{ (steps.skip.outputs.continue == '1') }}
12196 working-directory : ./src
12297 run : pytest pytorch_lightning --cov=pytorch_lightning
12398
12499 - name : Install extra dependencies
125- if : ${{ (steps.skip.outputs.continue == '1') }}
126100 run : |
127101 # adjust versions according installed Torch version
128102 python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt
@@ -131,7 +105,7 @@ jobs:
131105 shell : bash
132106
133107 - name : Reinstall Horovod if necessary
134- if : ${{ ( runner.os != 'windows') && (steps.skip.outputs.continue == '1') }}
108+ if : runner.os != 'windows'
135109 env :
136110 HOROVOD_BUILD_ARCH_FLAGS : " -mfma"
137111 HOROVOD_WITHOUT_MXNET : 1
@@ -148,51 +122,46 @@ jobs:
148122 shell : bash
149123
150124 - name : Cache datasets
151- if : ${{ (steps.skip.outputs.continue == '1') }}
152125 uses : actions/cache@v2
153126 with :
154127 path : Datasets
155128 key : pl-dataset
156129
157130 - name : Sanity check
158- if : ${{ (steps.skip.outputs.continue == '1') }}
159131 run : python requirements/pytorch/check-avail-extras.py
160132
161133 - name : Testing PyTorch
162- if : ${{ (steps.skip.outputs.continue == '1') }}
163134 working-directory : tests/tests_pytorch
164135 # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003
165136 run : coverage run --source pytorch_lightning -m pytest -v --durations=50 --junitxml=results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}.xml
166137
167138 - name : Upload pytest results
168- if : ${{ (failure()) && (steps.skip.outputs.continue == '1') }}
169139 uses : actions/upload-artifact@v3
170140 with :
171141 name : unittest-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}
172142 path : tests/tests_pytorch/results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}.xml
143+ if : failure()
173144
174145 - name : Prepare Examples
175- if : ${{ (steps.skip.outputs.continue == '1') }}
176146 run : |
177147 # adjust versions according installed Torch version
178148 python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt
179149 pip install -r requirements/pytorch/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
180150
181151 - name : Run Examples
182- if : ${{ (steps.skip.outputs.continue == '1') }}
183152 working-directory : ./examples
184153 run : python -m pytest test_pl_examples.py -v --durations=10
185154
186155 - name : Statistics
187- if : ${{ ( success()) && (steps.skip.outputs.continue == '1') }}
156+ if : success()
188157 working-directory : tests/tests_pytorch
189158 run : |
190159 coverage report
191160 coverage xml
192161
193162 - name : Upload coverage to Codecov
194163 uses : codecov/codecov-action@v3
195- if : ${{ ( always()) && (steps.skip.outputs.continue == '1') }}
164+ if : always()
196165 # see: https://github.com/actions/toolkit/issues/399
197166 continue-on-error : true
198167 with :
0 commit comments