Skip to content

Update build for JupyterLab 3.6 (#5) #5

Update build for JupyterLab 3.6 (#5)

Update build for JupyterLab 3.6 (#5) #5

Workflow file for this run

name: Build and Test Extension
on: [push, workflow_dispatch]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
steps:
# Get the current repo files and install node
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: List files in the repository
run: |
ls ${{ github.workspace }}
# Install jupyterlab
- name: Install JupyterLab
run: |
python -m pip install "jupyterlab>=3.5.0,<4"
jupyter lab --version
jupyter --paths
# Install the extension and show where it was installed
- name: Install the extension
run: |
python -m pip install .
jupyter labextension list
# Create the overrides.json file and copy the data from example_overrides, then set fetch source
- name: Set overrides
run: |
mkdir -p /home/runner/.local/etc/jupyter/labconfig
cp example_overrides.json /home/runner/.local/etc/jupyter/labconfig/default_setting_overrides.json
echo '{"nersc-refresh-announcements:plugin": { "url": "http://localhost:3000" } }' > /home/runner/.local/etc/jupyter/labconfig/default_setting_overrides.json
# Download and install gecko web driver
- name: Get web driver
run: |
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz
sudo tar -xzf geckodriver-v0.32.2-linux64.tar.gz -C /usr/bin
sudo chmod a+x /usr/bin/geckodriver
# Install selenium and pytest
- name: Install Selenium
run: python -m pip install selenium
- name: Install pytest
run: python -m pip install pytest
# Install necessary server packages and start the server
- name: Setup mock server for tests
run: |
cd tests/test-server
npm install express
npm install cors
npm install nodemon
npm install
cd ../..
(node ./tests/test-server/server.js &)
# Start jupyterlab and run the nonempty test
- name: Start jupyterlab
run: |
jupyter labextension list
jupyter lab --port=8888 --NotebookApp.token='' &
- name: Run nonempty test
run: |
pytest tests/test_nonempty_announcement.py
# Kill and restart the server
- name: Restart nodejs server
run: |
killall -9 node
cd tests/test-server
(node ./tests/test-server/server.js --empty-announcement &)
cd ../..
# Run empty announcements test
- name: Run empty announcement test
run: |
pytest tests/test_empty_announcement.py