2022-02-02 19:48:15 +00:00
|
|
|
name: Test with Conda
|
2020-06-30 14:56:05 +00:00
|
|
|
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
2020-09-10 22:38:29 +00:00
|
|
|
on: # Trigger the workflow on push or pull request, but only for the master branch
|
2020-06-30 14:56:05 +00:00
|
|
|
push:
|
2021-10-26 11:58:20 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-30 14:56:05 +00:00
|
|
|
pull_request:
|
2020-11-04 09:08:37 +00:00
|
|
|
branches: [master, "release/*"]
|
2020-06-30 14:56:05 +00:00
|
|
|
|
2022-02-02 19:48:15 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
|
|
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
|
|
|
2022-03-11 09:20:47 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash -l {0}
|
|
|
|
|
2020-06-30 14:56:05 +00:00
|
|
|
jobs:
|
|
|
|
conda:
|
2020-10-26 10:47:09 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
container: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python-version }}-torch${{ matrix.pytorch-version }}
|
2020-06-30 14:56:05 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-11-04 17:26:24 +00:00
|
|
|
python-version: ["3.8"] # previous to last Python version as that one is already used in test-full
|
2022-03-10 18:38:47 +00:00
|
|
|
pytorch-version: ["1.8", "1.9", "1.10"]
|
|
|
|
# nightly: add when there's a release candidate
|
|
|
|
include:
|
|
|
|
- {python-version: "3.9", pytorch-version: "1.11"}
|
2020-06-30 14:56:05 +00:00
|
|
|
|
2021-11-28 17:58:03 +00:00
|
|
|
timeout-minutes: 30
|
2020-06-30 14:56:05 +00:00
|
|
|
steps:
|
2022-04-14 10:29:29 +00:00
|
|
|
- name: Workaround for https://github.com/actions/checkout/issues/760
|
|
|
|
run: git config --global --add safe.directory /__w/pytorch-lightning/pytorch-lightning
|
|
|
|
|
2020-06-30 14:56:05 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-10-04 17:18:20 +00:00
|
|
|
- name: Update dependencies
|
2022-03-12 09:00:20 +00:00
|
|
|
env:
|
|
|
|
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
|
|
|
|
HOROVOD_WITHOUT_MXNET: 1
|
|
|
|
HOROVOD_WITHOUT_TENSORFLOW: 1
|
2020-06-30 14:56:05 +00:00
|
|
|
run: |
|
2022-03-12 09:00:20 +00:00
|
|
|
set -e
|
2020-10-04 17:18:20 +00:00
|
|
|
conda info
|
|
|
|
conda list
|
2021-03-06 13:34:54 +00:00
|
|
|
# adjust versions according installed Torch version
|
2022-03-11 09:20:47 +00:00
|
|
|
python ./requirements/adjust-versions.py requirements/extra.txt
|
|
|
|
python ./requirements/adjust-versions.py requirements/examples.txt
|
2022-03-12 09:00:20 +00:00
|
|
|
pip install -r requirements/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
2022-05-09 13:25:53 +00:00
|
|
|
pip install -r requirements/strategies.txt
|
2022-03-12 09:00:20 +00:00
|
|
|
# set a per-test timeout of 2.5 minutes to fail sooner; this aids with hanging tests
|
2021-11-28 17:58:03 +00:00
|
|
|
pip install pytest-timeout
|
2020-10-04 17:18:20 +00:00
|
|
|
pip list
|
2022-03-11 09:20:47 +00:00
|
|
|
# sanity check
|
|
|
|
python requirements/check-avail-extras.py
|
2020-06-30 14:56:05 +00:00
|
|
|
|
2021-01-08 15:36:49 +00:00
|
|
|
- name: Pull checkpoints from S3
|
2021-06-08 16:30:13 +00:00
|
|
|
working-directory: ./legacy
|
2021-01-08 15:36:49 +00:00
|
|
|
run: |
|
|
|
|
# enter legacy and update checkpoints from S3
|
|
|
|
curl https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip --output checkpoints.zip
|
|
|
|
unzip -o checkpoints.zip
|
|
|
|
ls -l checkpoints/
|
|
|
|
|
2020-06-30 14:56:05 +00:00
|
|
|
- name: Tests
|
|
|
|
run: |
|
2021-11-28 17:58:03 +00:00
|
|
|
coverage run --source pytorch_lightning -m pytest --timeout 150 pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml
|
2020-06-30 14:56:05 +00:00
|
|
|
|
2021-03-11 15:45:26 +00:00
|
|
|
- name: Upload pytest results
|
2020-11-04 09:08:37 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-06-30 14:56:05 +00:00
|
|
|
with:
|
2022-02-21 15:03:02 +00:00
|
|
|
name: pytest-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}
|
|
|
|
path: junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml
|
|
|
|
if-no-files-found: error
|
2020-12-11 23:17:19 +00:00
|
|
|
if: failure()
|
2021-03-11 15:45:26 +00:00
|
|
|
|
|
|
|
- name: Statistics
|
|
|
|
if: success()
|
|
|
|
run: |
|
|
|
|
coverage report
|
|
|
|
coverage xml
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
if: always()
|
|
|
|
# see: https://github.com/actions/toolkit/issues/399
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
file: coverage.xml
|
|
|
|
flags: cpu,pytest,torch${{ matrix.pytorch-version }}
|
|
|
|
name: CPU-coverage
|
|
|
|
fail_ci_if_error: false
|