Skip to content

Commit

Permalink
Enable Github Actions builds (#23)
Browse files Browse the repository at this point in the history
* fix: Fix linting errors in jupyterlab_wipp and jupyterhub_rtc_hub_settings
  • Loading branch information
ktaletsk authored Oct 8, 2021
1 parent 44ae5de commit 96c8426
Show file tree
Hide file tree
Showing 19 changed files with 905 additions and 721 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/github-actions-demo.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/jupyterlab-rtc-hub-settings-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build JupyterLab RTC Hub Settings extension

on:
push:
branches: master
paths:
- "jupyterlab_rtc_hub_settings/**"
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: jupyterlab_rtc_hub_settings
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'


- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.9-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.9-
pip-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v2
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: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.0 check-manifest

- name: Build the extension
run: |
set -eux
jlpm
jlpm run eslint:check
python -m pip install .
jupyter server extension list 2>&1 | grep -ie "jupyterlab_rtc_hub_settings.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyterlab_rtc_hub_settings.*OK"
python -m jupyterlab.browser_check
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Build
name: Build JupyterLab WIPP extension

on:
push:
branches: main
branches: master
paths:
- "jupyterlab_wipp/**"
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: jupyterlab_wipp
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -19,17 +25,17 @@ jobs:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'


- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.8-${{ hashFiles('package.json') }}
key: pip-3.9-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.8-
pip-3.9-
pip-
- name: Get yarn cache directory path
Expand All @@ -46,6 +52,7 @@ jobs:
- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.0 check-manifest

- name: Build the extension
run: |
set -eux
Expand All @@ -56,43 +63,4 @@ jobs:
jupyter server extension list 2>&1 | grep -ie "jupyterlab_wipp.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyterlab_wipp.*OK"
python -m jupyterlab.browser_check
check-manifest -v
pip install build
python -m build --sdist
cp dist/*.tar.gz myextension.tar.gz
pip uninstall -y myextension jupyterlab
rm -rf myextension
- uses: actions/upload-artifact@v2
with:
name: myextension-sdist
path: myextension.tar.gz

test_isolated:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: myextension-sdist
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install myextension.tar.gz
pip install jupyterlab
jupyter labextension list 2>&1 | grep -ie "jupyterlab_wipp.*OK"
python -m jupyterlab.browser_check --no-chrome-test
python -m jupyterlab.browser_check
66 changes: 66 additions & 0 deletions .github/workflows/jupyterlab-wipp-plugin-creator-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build JupyterLab WIPP Plugin Builder extension

on:
push:
branches: master
paths:
- "jupyterlab_wipp_plugin_creator/**"
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: jupyterlab_wipp_plugin_creator
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'


- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.9-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.9-
pip-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v2
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: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.0 check-manifest

- name: Build the extension
run: |
set -eux
jlpm
jlpm run eslint:check
python -m pip install .
jupyter server extension list 2>&1 | grep -ie "jupyterlab_wipp_plugin_creator.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyterlab_wipp_plugin_creator.*OK"
python -m jupyterlab.browser_check
19 changes: 11 additions & 8 deletions jupyterlab_rtc_hub_settings/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { JupyterFrontEnd, JupyterFrontEndPlugin, ILabShell } from '@jupyterlab/application';
import {
JupyterFrontEnd,
JupyterFrontEndPlugin,
ILabShell
} from '@jupyterlab/application';
import { SharingSettingsSidebar } from './sidebar';

/**
Expand All @@ -8,21 +12,20 @@ const plugin: JupyterFrontEndPlugin<void> = {
id: 'jupyterlab_rtc_hub_settings:plugin',
autoStart: true,
requires: [ILabShell],
activate: (
app: JupyterFrontEnd,
labShell: ILabShell
) => {
console.log('JupyterLab extension jupyterlab_rtc_hub_settings is activated!');
activate: (app: JupyterFrontEnd, labShell: ILabShell) => {
console.log(
'JupyterLab extension jupyterlab_rtc_hub_settings is activated!'
);

// Create the sharing settings sidebar panel
const sidebar = new SharingSettingsSidebar();
sidebar.id = 'rtc-hub-settings-labextension:plugin';
sidebar.title.iconClass = 'rtc-hub-settings-SharingSettingsLogo jp-SideBar-tabIcon';
sidebar.title.iconClass =
'rtc-hub-settings-SharingSettingsLogo jp-SideBar-tabIcon';
sidebar.title.caption = 'Sharing settings';

// Register sidebar panel with JupyterLab
labShell.add(sidebar, 'left', { rank: 600 });

}
};

Expand Down
Loading

0 comments on commit 96c8426

Please sign in to comment.