2020-06-30 14:56:05 +00:00
|
|
|
name: PyTorch & Conda
|
|
|
|
|
|
|
|
# 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:
|
2020-09-15 09:55:03 +00:00
|
|
|
branches: [master]
|
2020-06-30 14:56:05 +00:00
|
|
|
pull_request:
|
2020-09-15 09:55:03 +00:00
|
|
|
branches: [master]
|
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:
|
2020-10-26 10:47:09 +00:00
|
|
|
# os: [ubuntu-20.04]
|
2020-06-30 14:56:05 +00:00
|
|
|
python-version: [3.7]
|
2020-10-30 15:42:14 +00:00
|
|
|
pytorch-version: [1.3, 1.4, 1.5, 1.6, 1.7]
|
2020-06-30 14:56:05 +00:00
|
|
|
|
|
|
|
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
2020-07-31 11:52:17 +00:00
|
|
|
timeout-minutes: 35
|
2020-06-30 14:56:05 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-10-04 17:18:20 +00:00
|
|
|
- name: Update dependencies
|
2020-06-30 14:56:05 +00:00
|
|
|
run: |
|
2020-10-04 17:18:20 +00:00
|
|
|
conda info
|
|
|
|
conda list
|
|
|
|
pip install --requirement requirements/devel.txt --upgrade-strategy only-if-needed
|
|
|
|
pip list
|
2020-06-30 14:56:05 +00:00
|
|
|
|
|
|
|
- name: Cache datasets
|
2020-10-06 19:20:08 +00:00
|
|
|
# todo this probably does not work with docker images, rather cache dockers
|
2020-07-31 10:31:23 +00:00
|
|
|
uses: actions/cache@v2
|
2020-06-30 14:56:05 +00:00
|
|
|
with:
|
|
|
|
path: Datasets # This path is specific to Ubuntu
|
|
|
|
# Look to see if there is a cache hit for the corresponding requirements file
|
|
|
|
key: pl-dataset
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
run: |
|
|
|
|
# NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003
|
2020-10-20 14:38:17 +00:00
|
|
|
python -m pytest pytorch_lightning tests -v --color=yes --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
2020-06-30 14:56:05 +00:00
|
|
|
# coverage report
|
|
|
|
shell: bash -l {0}
|
|
|
|
|
|
|
|
- name: Upload pytest test results
|
|
|
|
uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}
|
|
|
|
path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
|
|
|
# Use always() to always run this step to publish test results when there are test failures
|
|
|
|
if: always()
|