From d73f66fab0aca2072d4c7482da4a7b35edcf9ecd Mon Sep 17 00:00:00 2001 From: Akihiro Nitta Date: Wed, 8 Jun 2022 09:48:07 +0900 Subject: [PATCH 1/5] Remove simple test --- .github/workflows/ci_test-base.yml | 81 ------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 .github/workflows/ci_test-base.yml diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml deleted file mode 100644 index 221f92d26ad5e..0000000000000 --- a/.github/workflows/ci_test-base.yml +++ /dev/null @@ -1,81 +0,0 @@ -# this jobs runs `pytest` over the source directory. It does not install any extra dependencies. -# this is useful to catch errors where an import has been added which is not part of the basic dependencies. -name: Test simple - -# 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/*"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} - cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }} - -jobs: - source: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04] - # this will install stable torch - python-version: [3.9] - - # lower timeout as this should run very quickly - timeout-minutes: 20 - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - 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 - - # Note: This uses an internal pip API and may not always work - # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow - - 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 }} - key: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements/base.txt') }} - restore-keys: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.requires }}- - - - name: Install dependencies - run: | - python --version - python -m pip install --upgrade --user pip - pip --version - pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade - pip install -r requirements/test.txt - pip list - shell: bash - - - name: Test Package [only] - run: | - coverage run --source pytorch_lightning -m pytest pytorch_lightning -v - - - 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 - name: Base-coverage - fail_ci_if_error: false From 5e6d839a6dd35e1fe74f4a4d388096b5ed568d89 Mon Sep 17 00:00:00 2001 From: Akihiro Nitta Date: Wed, 8 Jun 2022 16:52:05 +0900 Subject: [PATCH 2/5] Update docs --- .github/workflows/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 0932a7879bdca..834ef18d89ff7 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -25,7 +25,6 @@ | workflow file | action | | ---------------------------------- | -------------------------------------------------------------------------------------------- | -| .github/workflows/ci_test-base.yml | Validate code examples in docstrings in the package with pytest’s doctest. | | .github/workflows/docs-checks.yml | Run doctest, build documentation, and upload built docs to make them available as artifacts. | | .circleci/config.yml (build-docs) | Build docs and host them on output.circleci-artifacts.com for easy access to the built docs. | | .github/workflows/docs-link.yml | Provide a direct link to built docs on output.circleci-artifacts.com. | From 4d1c844a2a652822661e0d5f3818eacfe205ccf9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Jun 2022 07:53:39 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 834ef18d89ff7..0a99440ede02a 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -23,11 +23,11 @@ ## Documentation -| workflow file | action | -| ---------------------------------- | -------------------------------------------------------------------------------------------- | -| .github/workflows/docs-checks.yml | Run doctest, build documentation, and upload built docs to make them available as artifacts. | -| .circleci/config.yml (build-docs) | Build docs and host them on output.circleci-artifacts.com for easy access to the built docs. | -| .github/workflows/docs-link.yml | Provide a direct link to built docs on output.circleci-artifacts.com. | +| workflow file | action | +| --------------------------------- | -------------------------------------------------------------------------------------------- | +| .github/workflows/docs-checks.yml | Run doctest, build documentation, and upload built docs to make them available as artifacts. | +| .circleci/config.yml (build-docs) | Build docs and host them on output.circleci-artifacts.com for easy access to the built docs. | +| .github/workflows/docs-link.yml | Provide a direct link to built docs on output.circleci-artifacts.com. | ## Code Quality From a4d478ca1d82042d6388f6db2f7fb26605090ac6 Mon Sep 17 00:00:00 2001 From: Jirka Date: Wed, 8 Jun 2022 17:04:17 +0200 Subject: [PATCH 4/5] doctest --- .github/workflows/ci_test-conda.yml | 20 ++++++++++++++++---- .github/workflows/ci_test-full.yml | 11 +++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index 7e6b8842eab5d..231ebaad98dd4 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -35,15 +35,27 @@ jobs: - uses: actions/checkout@v2 - - name: Update dependencies + - name: Update base dependencies env: HOROVOD_BUILD_ARCH_FLAGS: "-mfma" HOROVOD_WITHOUT_MXNET: 1 HOROVOD_WITHOUT_TENSORFLOW: 1 run: | - set -e conda info conda list + pip install -r requirements/test.txt + + - name: DocTests + run: | + coverage run --source pytorch_lightning -m pytest pytorch_lightning + + - name: Update all dependencies + env: + HOROVOD_BUILD_ARCH_FLAGS: "-mfma" + HOROVOD_WITHOUT_MXNET: 1 + HOROVOD_WITHOUT_TENSORFLOW: 1 + run: | + set -e # adjust versions according installed Torch version python ./requirements/adjust-versions.py requirements/extra.txt python ./requirements/adjust-versions.py requirements/examples.txt @@ -58,9 +70,9 @@ jobs: - name: Pull legacy checkpoints run: bash .actions/pull_legacy_checkpoints.sh - - name: Tests + - name: UnitTests run: | - 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 + coverage run --source pytorch_lightning -m pytest --timeout 150 tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml - name: Upload pytest results uses: actions/upload-artifact@v2 diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index b1a1ac4c5d4a3..bca5699d43029 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -84,13 +84,13 @@ jobs: flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1) url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1) pip install -r requirements.txt --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}" - # adjust versions according installed Torch version - python ./requirements/adjust-versions.py requirements/examples.txt - pip install -r requirements/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade pip install -r requirements/test.txt --upgrade pip list shell: bash + - name: DocTests + run: coverage run --source pytorch_lightning -m pytest pytorch_lightning + - name: Install extra dependencies run: | # adjust versions according installed Torch version @@ -126,13 +126,16 @@ jobs: run: | python requirements/check-avail-extras.py - - name: Tests + - name: UnitTests run: | # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}.xml - name: Examples run: | + # adjust versions according installed Torch version + python ./requirements/adjust-versions.py requirements/examples.txt + pip install -r requirements/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade python -m pytest pl_examples -v --durations=10 - name: Upload pytest results From f7feed8cc330323f49a533b755afcbcfa6d3171a Mon Sep 17 00:00:00 2001 From: Jirka Date: Wed, 8 Jun 2022 17:05:45 +0200 Subject: [PATCH 5/5] env --- .github/workflows/ci_test-conda.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index 231ebaad98dd4..0466a83760338 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -36,10 +36,6 @@ jobs: - uses: actions/checkout@v2 - name: Update base dependencies - env: - HOROVOD_BUILD_ARCH_FLAGS: "-mfma" - HOROVOD_WITHOUT_MXNET: 1 - HOROVOD_WITHOUT_TENSORFLOW: 1 run: | conda info conda list