2022-02-02 19:48:15 +00:00
|
|
|
name: Test slow
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
|
|
|
on: # Trigger the workflow on push or pull request, but only for the master branch
|
|
|
|
push:
|
|
|
|
branches: [master, "release/*"]
|
|
|
|
pull_request:
|
|
|
|
branches: [master, "release/*"]
|
|
|
|
|
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/')) }}
|
|
|
|
|
2021-12-01 19:58:18 +00:00
|
|
|
jobs:
|
|
|
|
slow:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macOS-latest]
|
|
|
|
# same config as '.azure-pipelines/gpu-tests.yml'
|
|
|
|
python-version: ["3.7"]
|
|
|
|
pytorch-version: ["1.8"]
|
|
|
|
|
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
2022-03-23 09:14:29 +00:00
|
|
|
- name: Reset caching
|
|
|
|
run: python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
- name: Get pip cache
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
|
|
|
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
2022-03-23 09:14:29 +00:00
|
|
|
key: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
|
2021-12-01 19:58:18 +00:00
|
|
|
restore-keys: |
|
2022-03-23 09:14:29 +00:00
|
|
|
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
# adjust versions according installed Torch version
|
2022-03-11 09:20:47 +00:00
|
|
|
python ./requirements/adjust-versions.py requirements.txt ${{ matrix.pytorch-version }}
|
2021-12-01 19:58:18 +00:00
|
|
|
pip install --requirement requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
|
|
|
|
pip install --requirement requirements/test.txt
|
|
|
|
pip list
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
run: |
|
2022-02-21 15:03:02 +00:00
|
|
|
coverage run --source pytorch_lightning -m pytest tests -v --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}.xml
|
2021-12-01 19:58:18 +00:00
|
|
|
env:
|
|
|
|
PL_RUN_SLOW_TESTS: 1
|
|
|
|
|
|
|
|
- name: Upload pytest test results
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-02-21 15:03:02 +00:00
|
|
|
name: pytest-results-${{ runner.os }}-py${{ matrix.python-version }}
|
|
|
|
path: junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}.xml
|
|
|
|
if-no-files-found: error
|
2021-12-01 19:58:18 +00:00
|
|
|
if: failure()
|
|
|
|
|
|
|
|
- name: Statistics
|
|
|
|
if: success()
|
|
|
|
run: |
|
|
|
|
coverage report
|
|
|
|
coverage xml
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
if: success()
|
|
|
|
# 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
|