From 38643997b381bc6a58d95c25a817b3cb201853e3 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 09:38:12 -0500 Subject: [PATCH] Clean up workflows (#747) --- .github/workflows/python-macos.yml | 46 -------------- .../{python-linux.yml => python-tests.yml} | 62 ++++++++++++------- .github/workflows/python-windows.yml | 42 ------------- 3 files changed, 39 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/python-macos.yml rename .github/workflows/{python-linux.yml => python-tests.yml} (69%) delete mode 100644 .github/workflows/python-windows.yml diff --git a/.github/workflows/python-macos.yml b/.github/workflows/python-macos.yml deleted file mode 100644 index f12c62676e..0000000000 --- a/.github/workflows/python-macos.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Jupyter Server Tests [Mac OS] -on: - push: - branches: ["main"] - pull_request: - branches: ["*"] -jobs: - build: - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install the Python dependencies - run: | - pip install -e .[test] codecov - pip install pytest-github-actions-annotate-failures - - name: List installed packages - run: | - pip freeze - pip check - - name: Run the tests - if: ${{ !startsWith( matrix.python-version, 'pypy' ) }} - run: | - pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered || pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --lf - - name: Run the tests on pypy - if: ${{ startsWith( matrix.python-version, 'pypy' ) }} - run: | - pytest -vv || pytest -vv --lf - - name: Install the Python dependencies for the examples - run: | - cd examples/simple && pip install -e . - - name: Run the tests for the examples - run: | - pytest examples/simple - - name: Coverage - if: ${{ !startsWith( matrix.python-version, 'pypy' ) }} - run: | - codecov diff --git a/.github/workflows/python-linux.yml b/.github/workflows/python-tests.yml similarity index 69% rename from .github/workflows/python-linux.yml rename to .github/workflows/python-tests.yml index 5b96aea3bb..95327a0cc8 100644 --- a/.github/workflows/python-linux.yml +++ b/.github/workflows/python-tests.yml @@ -1,4 +1,4 @@ -name: Jupyter Server Tests [Linux] +name: Jupyter Server Tests on: push: branches: ["main"] @@ -37,8 +37,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.7", "3.10"] + include: + - os: windows-latest + python-version: "3.9" + - os: ubuntu-latest + python-version: "pypy-3.7" + - os: macos-latest + python-version: "3.8" steps: - name: Checkout uses: actions/checkout@v2 @@ -47,35 +54,41 @@ jobs: - name: Install the Python dependencies run: | pip install -e ".[test]" codecov - - name: List installed packages - run: | - pip freeze - pip check - name: Run the tests - if: ${{ matrix.python-version != 'pypy-3.7' }} + if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | - pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70 || pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70 --lf - - name: Run the tests on pypy - if: ${{ matrix.python-version == 'pypy-3.7' }} + args="-vv -raXs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" + python -m pytest $args || python -m pytest $args --lf + - name: Run the tests on pypy and windows + if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }} run: | - pytest -vv || pytest -vv -lf + python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf + - name: Coverage + run: | + codecov + + test_docs_and_examples: + name: Test Docs and Examples + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install the Python dependencies for the examples run: | + pip install -e ".[test]" cd examples/simple && pip install -e . - name: Run the tests for the examples run: | - pytest examples/simple - - name: Coverage - if: ${{ matrix.python-version != 'pypy-3.7' }} - run: | - codecov + python -m pytest examples/simple - name: Test the docs run: | cd docs pip install -r doc-requirements.txt make html SPHINXOPTS="-W" - test_miniumum_verisons: + test_miniumum_versions: name: Test Minimum Versions timeout-minutes: 20 runs-on: ubuntu-latest @@ -88,7 +101,9 @@ jobs: - name: Install miniumum versions uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 - name: Run the unit tests - run: pytest -vv|| pytest -vv --lf + run: | + args="-vv -raXs --durations 10 --color=yes" + pytest $args || pytest $args --lf test_prereleases: name: Test Prereleases @@ -108,7 +123,8 @@ jobs: pip check - name: Run the tests run: | - pytest -vv || pytest -vv --lf + args="-vv -raXs --durations 10 --color=yes" + pytest $args || pytest $args --lf make_sdist: name: Make SDist @@ -142,11 +158,11 @@ jobs: set -ex cd sdist mkdir test - tar --strip-components=1 -zxvf jupyter_server* -C ./test + tar --strip-components=1 -zxvf *.tar.gz -C ./test cd test pip install .[test] - pip install pytest-github-actions-annotate-failures - name: Run Test run: | cd sdist/test - pytest -vv || pytest -vv --lf + args="-vv -raXs --durations 10 --color=yes" + pytest $args || pytest $args --lf diff --git a/.github/workflows/python-windows.yml b/.github/workflows/python-windows.yml deleted file mode 100644 index c4b078c04f..0000000000 --- a/.github/workflows/python-windows.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Jupyter Server Tests [Windows] -on: - push: - branches: ["main"] - pull_request: - branches: ["*"] -jobs: - build: - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install the Python dependencies - run: | - pip install -e .[test] - pip install pytest-github-actions-annotate-failures - - name: List installed packages - run: | - pip freeze - pip check - - name: Run the tests - run: | - # Disable capturing (-s) output from Pytest on Windows. - # For an unknown reason, capturing output interferes with - # the file descriptions opened by the asyncio IOLoop. - # This leads to a nasty, flaky race condition that we haven't - # been able to solve. - pytest -vv -s || pytest -vv -s --lf - - name: Install the Python dependencies for the examples - run: | - cd examples/simple && pip install -e . - - name: Run the tests for the examples - run: | - pytest examples/simple