Test #618
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
# | |
name: Test | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "contrib/**" | |
- "**.md" | |
- "**.rst" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "contrib/**" | |
- "**.md" | |
- "**.rst" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
branches-ignore: | |
- "dependabot/**" | |
- "pre-commit-ci-update-config" | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
# Keep running even if one variation of the job fail | |
fail-fast: false | |
matrix: | |
# We run this job multiple times with different parameterization | |
# specified below, these parameters have no meaning on their own and | |
# gain meaning on how job steps use them. | |
jupyterlab_version: [2, 3] | |
python: [3.6, 3.7, 3.8, 3.9] | |
jupyter_app: [notebook, lab] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "${{ matrix.python }}" | |
- name: Build Python package | |
id: build-package | |
run: | | |
pip install jupyter_packaging wheel jupyterlab | |
python setup.py sdist bdist_wheel | |
- name: Install Python dependencies | |
# NOTE: See CONTRIBUTING.md for a local development setup that differs | |
# slightly from this. | |
# | |
# Pytest options are set in tests/pytest.ini. | |
run: | | |
pip install --upgrade pip | |
pip install jupyter_packaging jupyterlab~=${{ matrix.jupyterlab_version }}.0 | |
pip install ./dist/jupyter_server_proxy-*.whl | |
pip install pytest pytest-cov pytest-html | |
# Ensure we don't accidentally depend on notebook | |
if [ "${{ matrix.jupyter_app }}" == "notebook" ]; then | |
pip install "notebook<7" | |
fi | |
pip freeze | |
- name: Run tests | |
run: | | |
JUPYTER_TOKEN=secret jupyter-${{ matrix.jupyter_app }} --config=./tests/resources/jupyter_server_config.py & | |
sleep 5 | |
cd tests | |
pytest | |
- name: Upload pytest and coverage reports | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: unit-tests-${{matrix.python }}-${{ matrix.jupyter_app }}-${{matrix.jupyterlab_version}}-${{ github.run_number }} | |
path: | | |
./build/pytest | |
./build/coverage | |
- name: Check the Notebook Server extension is installed | |
run: | | |
jupyter serverextension list | |
jupyter serverextension list 2>&1 | grep -ie "jupyter_server_proxy.*enabled" - | |
- name: Check the Jupyter Server extension is installed | |
run: | | |
pip install jupyter-server | |
jupyter server extension list | |
jupyter server extension list 2>&1 | grep -ie "jupyter_server_proxy.*enabled" - | |
- name: Install JupyterLab Extension | |
if: matrix.jupyterlab_version == '2' | |
run: | | |
cd jupyterlab-server-proxy | |
jupyter labextension install . --no-build --debug | |
jupyter lab build --minimize=False --debug | |
- name: Check the lab extension | |
run: | | |
jupyter labextension list | |
jupyter labextension list 2>&1 | grep -ie '@jupyterlab/server-proxy.*OK.*' | |
python -m jupyterlab.browser_check | |
- name: Install Acceptance test dependencies | |
run: | | |
# the acceptance test requires notebook to run | |
pip install "notebook<7" robotframework-jupyterlibrary | |
- name: Run acceptance tests | |
run: | | |
pytest -k acceptance -s | |
- name: Upload acceptance test reports | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: acceptance-tests-${{ matrix.python }}-${{ matrix.jupyter_app }}-${{ matrix.jupyterlab_version }}-${{ github.run_number }} | |
path: | | |
./build/robot |