|  | 
|  | 1 | +name: Build Jupyter extension | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  push: | 
|  | 5 | +    branches: main | 
|  | 6 | +  pull_request: | 
|  | 7 | +    branches: '*' | 
|  | 8 | + | 
|  | 9 | +jobs: | 
|  | 10 | +  build: | 
|  | 11 | +    runs-on: ubuntu-latest | 
|  | 12 | +    defaults: | 
|  | 13 | +      run: | 
|  | 14 | +        working-directory: webio_jupyter_extension | 
|  | 15 | + | 
|  | 16 | +    steps: | 
|  | 17 | +    - name: Checkout | 
|  | 18 | +      uses: actions/checkout@v4 | 
|  | 19 | + | 
|  | 20 | +    - name: Base Setup | 
|  | 21 | +      uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | 
|  | 22 | + | 
|  | 23 | +    - name: Build WebIO (@webio/webio) | 
|  | 24 | +      working-directory: . | 
|  | 25 | +      run: | | 
|  | 26 | +        set -eux | 
|  | 27 | +        npm -C packages install --scripts-prepend-node-path=auto | 
|  | 28 | +        npm -C packages run build-prod --scripts-prepend-node-path=auto | 
|  | 29 | +
 | 
|  | 30 | +    - name: Install dependencies | 
|  | 31 | +      run: | | 
|  | 32 | +        set -eux | 
|  | 33 | +        python -m pip install -U "jupyterlab>=4.0.0,<5" | 
|  | 34 | +        jlpm install | 
|  | 35 | +
 | 
|  | 36 | +    - name: Lint the extension | 
|  | 37 | +      run: | | 
|  | 38 | +        set -eux | 
|  | 39 | +        jlpm | 
|  | 40 | +        jlpm run eslint:check | 
|  | 41 | +
 | 
|  | 42 | +    - name: Build the extension | 
|  | 43 | +      run: | | 
|  | 44 | +        set -eux | 
|  | 45 | +        python -m pip install .[test] | 
|  | 46 | +
 | 
|  | 47 | +        jupyter server extension list | 
|  | 48 | +        jupyter server extension list 2>&1 | grep -ie "webio_jupyter_extension.*OK" | 
|  | 49 | +
 | 
|  | 50 | +        jupyter labextension list | 
|  | 51 | +        jupyter labextension list 2>&1 | grep -ie "webio-jupyterlab-provider.*OK" | 
|  | 52 | +        python -m jupyterlab.browser_check | 
|  | 53 | +
 | 
|  | 54 | +    - name: Package the extension | 
|  | 55 | +      run: | | 
|  | 56 | +        set -eux | 
|  | 57 | +
 | 
|  | 58 | +        pip install build | 
|  | 59 | +        python -m build | 
|  | 60 | +        pip uninstall -y "webio-jupyter-extension" jupyterlab | 
|  | 61 | +
 | 
|  | 62 | +    - name: Upload extension packages | 
|  | 63 | +      uses: actions/upload-artifact@v4 | 
|  | 64 | +      with: | 
|  | 65 | +        name: extension-artifacts | 
|  | 66 | +        path: webio_jupyter_extension/dist/webio_jupyter_extension* | 
|  | 67 | +        if-no-files-found: error | 
|  | 68 | + | 
|  | 69 | +  test_isolated: | 
|  | 70 | +    needs: build | 
|  | 71 | +    runs-on: ubuntu-latest | 
|  | 72 | + | 
|  | 73 | +    steps: | 
|  | 74 | +    - name: Install Python | 
|  | 75 | +      uses: actions/setup-python@v5 | 
|  | 76 | +      with: | 
|  | 77 | +        python-version: '3.9' | 
|  | 78 | +        architecture: 'x64' | 
|  | 79 | +    - uses: actions/download-artifact@v4 | 
|  | 80 | +      with: | 
|  | 81 | +        name: extension-artifacts | 
|  | 82 | +    - name: Install and Test | 
|  | 83 | +      run: | | 
|  | 84 | +        set -eux | 
|  | 85 | +        # Remove NodeJS, twice to take care of system and locally installed node versions. | 
|  | 86 | +        sudo rm -rf $(which node) | 
|  | 87 | +        sudo rm -rf $(which node) | 
|  | 88 | +
 | 
|  | 89 | +        pip install "jupyterlab>=4.0.0,<5" webio_jupyter_extension*.whl | 
|  | 90 | +
 | 
|  | 91 | +
 | 
|  | 92 | +        jupyter server extension list | 
|  | 93 | +        jupyter server extension list 2>&1 | grep -ie "webio_jupyter_extension.*OK" | 
|  | 94 | +
 | 
|  | 95 | +        jupyter labextension list | 
|  | 96 | +        jupyter labextension list 2>&1 | grep -ie "webio-jupyterlab-provider.*OK" | 
|  | 97 | +        python -m jupyterlab.browser_check --no-browser-test | 
|  | 98 | +
 | 
0 commit comments