@@ -43,61 +43,79 @@ jobs:
4343
4444 steps :
4545 - uses : actions/checkout@v3
46+
4647 - uses : actions/setup-python@v4
4748 with :
4849 python-version : " ${{ matrix.python-version }}"
50+ cache : pip
51+ cache-dependency-path : pyproject.toml
52+
53+ - uses : actions/setup-node@v3
54+ with :
55+ cache : yarn
56+ node-version : 18.x
57+ registry-url : https://registry.npmjs.org
58+ cache-dependency-path : labextension/yarn.lock
59+
60+ - name : Update root build packages
61+ run : |
62+ pip install --upgrade build pip
4963
5064 - name : Build Python package
5165 run : |
52- pip install jupyter_packaging wheel jupyterlab
53- python setup.py sdist bdist_wheel
66+ pyproject-build
5467
55- - name : Install Python dependencies
68+ - name : Install Python package
5669 # NOTE: See CONTRIBUTING.md for a local development setup that differs
5770 # slightly from this.
5871 #
5972 # Pytest options are set in tests/pytest.ini.
6073 run : |
61- pip install --upgrade pip
62- pip install jupyter_packaging jupyterlab~=${{ matrix.jupyterlab-version }}.0
63- pip install ./dist/jupyter_server_proxy-*.whl
64- pip install pytest pytest-cov pytest-html
65- # Ensure we don't accidentally depend on notebook
66- if [ "${{ matrix.jupyter-app }}" == "notebook" ]; then
67- pip install "notebook<7"
68- fi
74+ set -eux
75+ pip install -vv $(ls ./dist/jupyter_server_proxy-*.whl)\[acceptance\] 'jupyterlab~=${{ matrix.jupyterlab-version }}.0'
76+
77+ - name : List Python packages
78+ run : |
79+ set -eux
6980 pip freeze
81+ pip check
7082
7183 - name : Run tests
7284 run : |
85+ set -eux
7386 JUPYTER_TOKEN=secret jupyter-${{ matrix.jupyter-app }} --config=./tests/resources/jupyter_server_config.py &
7487 sleep 5
7588 cd tests
76- pytest
89+ pytest -k "not acceptance"
7790
7891 - name : Upload pytest and coverage reports
7992 if : always()
8093 uses : actions/upload-artifact@v3
8194 with :
82- name : unit-tests-${{ matrix.python-version }}-${{ matrix.jupyter-app }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
95+ name : |-
96+ unit-tests-${{ matrix.python-version }}-${{ matrix.jupyter-app }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
8397 path : |
8498 ./build/pytest
8599 ./build/coverage
86100
87101 - name : Check the Notebook Server extension is installed
88102 run : |
103+ set -eux
89104 jupyter serverextension list
90- jupyter serverextension list 2>&1 | grep -ie "jupyter_server_proxy.*enabled " -
105+ jupyter serverextension list 2>&1 | grep -iE "jupyter_server_proxy.*OK " -
91106
92107 - name : Check the Jupyter Server extension is installed
93108 run : |
109+ set -eux
94110 pip install jupyter-server
95111 jupyter server extension list
96- jupyter server extension list 2>&1 | grep -ie "jupyter_server_proxy.*enabled " -
112+ jupyter server extension list 2>&1 | grep -iE "jupyter_server_proxy.*OK " -
97113
98114 - name : Install JupyterLab Extension
99115 if : matrix.jupyterlab-version == '2'
100116 run : |
117+ set -eux
118+ export NODE_OPTIONS=--openssl-legacy-provider
101119 cd labextension
102120 jupyter labextension install . --no-build --debug
103121 jupyter lab build --minimize=False --debug
@@ -108,25 +126,23 @@ jobs:
108126 # jupyterlab.browser_check with jupyterlab 2 and a modern version of
109127 # python (3.11+).
110128 #
111- if : ${{ !(matrix.jupyterlab-version == '2' && startsWith(matrix.python-version, '3.1 ')) }}
129+ if : ${{ !(matrix.jupyterlab-version == '2' && startsWith(matrix.python-version, '3.11 ')) }}
112130 run : |
131+ set -eux
113132 jupyter labextension list
114- jupyter labextension list 2>&1 | grep -ie '@jupyterhub/jupyter-server-proxy.*OK.*'
133+ jupyter labextension list 2>&1 | grep -iE '@jupyterhub/jupyter-server-proxy.*OK.*'
115134 python -m jupyterlab.browser_check
116135
117- - name : Install Acceptance test dependencies
118- run : |
119- # the acceptance test requires notebook to run
120- pip install "notebook<7" "robotframework-jupyterlibrary>=0.4.2"
121-
122136 - name : Run acceptance tests
123137 run : |
124- pytest -k acceptance -s
138+ set -eux
139+ pytest -s -k "acceptance"
125140
126141 - name : Upload acceptance test reports
127142 if : always()
128143 uses : actions/upload-artifact@v3
129144 with :
130- name : acceptance-tests-${{ matrix.python-version }}-${{ matrix.jupyter-app }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
145+ name : |-
146+ acceptance-tests-${{ matrix.python-version }}-${{ matrix.jupyter-app }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
131147 path : |
132148 ./build/robot
0 commit comments