7.x: Fix widget state saving logic for JupyterLab 4 #1650
Workflow file for this run
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
name: Build jupyterlab_widgets | |
on: | |
push: | |
branches: master | |
pull_request: | |
branches: '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Install Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.8' | |
architecture: 'x64' | |
- name: Cache pip on Linux | |
uses: actions/cache@v1 | |
if: startsWith(runner.os, 'Linux') | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.python }} | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache yarn | |
uses: actions/cache@v1 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: | | |
python -m pip install jupyterlab~=3.0 | |
python -m pip install jupyter_packaging~=0.7.9 | |
- name: Build the extension | |
run: | | |
yarn install --frozen-lockfile | |
yarn run build | |
yarn run build:examples | |
# First install the dev jupyterlab_widgets, since it is a dependency | |
pushd jupyterlab_widgets | |
pwd | |
pip install -e . | |
jupyter labextension develop . --overwrite | |
jupyter labextension list | |
popd | |
# Finally, install the base ipywidgets package now that we have the jupyterlab_widgets dependency | |
pip install -e .[test] | |
- name: Run Python tests | |
run: pytest . | |
- name: Run JS tests | |
run: | | |
pushd packages/base | |
yarn run test:unit:firefox:headless | |
popd | |
pushd packages/controls | |
yarn run test:unit:firefox:headless | |
popd | |
pushd packages/html-manager | |
yarn run test:unit:firefox:headless | |
popd | |
pushd examples/web1 | |
yarn run test:firefox:headless | |
popd |