From 92d842117c7bdd81a286bae4ed8424a1e52812ca Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Wed, 23 Dec 2020 19:16:50 +0000 Subject: [PATCH] Follow up to fix CI --- .../workflows/{main.yml => python-linux.yml} | 7 +-- .github/workflows/python-macos.yml | 56 +++++++++++++++++++ .github/workflows/python-windows.yml | 53 ++++++++++++++++++ 3 files changed, 111 insertions(+), 5 deletions(-) rename .github/workflows/{main.yml => python-linux.yml} (92%) create mode 100644 .github/workflows/python-macos.yml create mode 100644 .github/workflows/python-windows.yml diff --git a/.github/workflows/main.yml b/.github/workflows/python-linux.yml similarity index 92% rename from .github/workflows/main.yml rename to .github/workflows/python-linux.yml index 7ffdefeb7c..8eb4c6aba6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/python-linux.yml @@ -1,4 +1,4 @@ -name: Jupyter Server Tests +name: Jupyter Server Tests [Linux] on: push: branches: '*' @@ -10,11 +10,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu, macos, windows] + os: [ubuntu] python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy3' ] - exclude: - - os: windows - python-version: pypy3 steps: - name: Checkout uses: actions/checkout@v1 diff --git a/.github/workflows/python-macos.yml b/.github/workflows/python-macos.yml new file mode 100644 index 0000000000..6d641e3081 --- /dev/null +++ b/.github/workflows/python-macos.yml @@ -0,0 +1,56 @@ +name: Jupyter Server Tests [Mac OS] +on: + push: + branches: '*' + pull_request: + branches: '*' +jobs: + build: + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [macos] + python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy3' ] + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + - name: Upgrade packaging dependencies + run: | + pip install --upgrade pip setuptools wheel --user + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip + uses: actions/cache@v1 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + - name: Install the Python dependencies + run: | + pip install -e .[test] codecov + - name: List installed packages + run: | + pip freeze + pip check + - name: Run the tests + run: | + pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered + - 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/tests/test_handlers.py + - name: Coverage + run: | + codecov diff --git a/.github/workflows/python-windows.yml b/.github/workflows/python-windows.yml new file mode 100644 index 0000000000..2e476e77f2 --- /dev/null +++ b/.github/workflows/python-windows.yml @@ -0,0 +1,53 @@ +name: Jupyter Server Tests [Windows] +on: + push: + branches: '*' + pull_request: + branches: '*' +jobs: + build: + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [windows] + python-version: [ '3.6', '3.7', '3.8', '3.9' ] + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + - name: Upgrade packaging dependencies + run: | + pip install --upgrade pip setuptools wheel --user + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip + uses: actions/cache@v1 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + - name: Install the Python dependencies + run: | + pip install -e .[test] codecov + - name: List installed packages + run: | + pip freeze + pip check + - name: Run the tests + run: | + pytest -vv + - 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/tests/test_handlers.py