Skip to content

Commit 76893b8

Browse files
committed
Create project
0 parents  commit 76893b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11387
-0
lines changed

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
coverage
4+
**/*.d.ts
5+
tests
6+
7+
**/__tests__
8+
ui-tests

.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/eslint-recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:prettier/recommended'
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: 'tsconfig.json',
11+
sourceType: 'module'
12+
},
13+
plugins: ['@typescript-eslint'],
14+
rules: {
15+
'@typescript-eslint/naming-convention': [
16+
'error',
17+
{
18+
selector: 'interface',
19+
format: ['PascalCase'],
20+
custom: {
21+
regex: '^I[A-Z]',
22+
match: true
23+
}
24+
}
25+
],
26+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-namespace': 'off',
29+
'@typescript-eslint/no-use-before-define': 'off',
30+
'@typescript-eslint/quotes': [
31+
'error',
32+
'single',
33+
{ avoidEscape: true, allowTemplateLiterals: false }
34+
],
35+
curly: ['error', 'all'],
36+
eqeqeq: 'error',
37+
'prefer-arrow-callback': 'error'
38+
}
39+
};

.github/workflows/binder-on-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
13+
with:
14+
15+
github_token: ${{ secrets.github_token }}
16+

.github/workflows/build.yml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Install dependencies
21+
run: python -m pip install -U "jupyterlab>=4.0.0a34,<5"
22+
23+
- name: Lint the extension
24+
run: |
25+
set -eux
26+
jlpm
27+
jlpm run lint:check
28+
29+
- name: Test the extension
30+
run: |
31+
set -eux
32+
jlpm run test
33+
34+
- name: Build the extension
35+
run: |
36+
set -eux
37+
python -m pip install .[test]
38+
39+
pytest -vv -r ap --cov glue_lab
40+
jupyter server extension list
41+
jupyter server extension list 2>&1 | grep -ie "glue_lab.*OK"
42+
43+
jupyter labextension list
44+
jupyter labextension list 2>&1 | grep -ie "glue-lab.*OK"
45+
python -m jupyterlab.browser_check
46+
47+
- name: Package the extension
48+
run: |
49+
set -eux
50+
51+
pip install build
52+
python -m build
53+
pip uninstall -y "glue_lab" jupyterlab
54+
55+
- name: Upload extension packages
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: extension-artifacts
59+
path: dist/glue_lab*
60+
if-no-files-found: error
61+
62+
test_isolated:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v3
69+
- name: Install Python
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: '3.9'
73+
architecture: 'x64'
74+
- uses: actions/download-artifact@v3
75+
with:
76+
name: extension-artifacts
77+
- name: Install and Test
78+
run: |
79+
set -eux
80+
# Remove NodeJS, twice to take care of system and locally installed node versions.
81+
sudo rm -rf $(which node)
82+
sudo rm -rf $(which node)
83+
84+
pip install "jupyterlab>=4.0.0a34,<5" glue_lab*.whl
85+
86+
87+
jupyter server extension list
88+
jupyter server extension list 2>&1 | grep -ie "glue_lab.*OK"
89+
90+
jupyter labextension list
91+
jupyter labextension list 2>&1 | grep -ie "glue-lab.*OK"
92+
python -m jupyterlab.browser_check --no-browser-test
93+
94+
integration-tests:
95+
name: Integration tests
96+
needs: build
97+
runs-on: ubuntu-latest
98+
99+
env:
100+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
101+
102+
steps:
103+
- name: Checkout
104+
uses: actions/checkout@v3
105+
106+
- name: Base Setup
107+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
108+
109+
- name: Download extension package
110+
uses: actions/download-artifact@v3
111+
with:
112+
name: extension-artifacts
113+
114+
- name: Install the extension
115+
run: |
116+
set -eux
117+
python -m pip install "jupyterlab>=4.0.0a34,<5" glue_lab*.whl
118+
119+
- name: Install dependencies
120+
working-directory: ui-tests
121+
env:
122+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
123+
run: jlpm install
124+
125+
- name: Set up browser cache
126+
uses: actions/cache@v3
127+
with:
128+
path: |
129+
${{ github.workspace }}/pw-browsers
130+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
131+
132+
- name: Install browser
133+
run: jlpm playwright install chromium
134+
working-directory: ui-tests
135+
136+
- name: Execute integration tests
137+
working-directory: ui-tests
138+
run: |
139+
jlpm playwright test
140+
141+
- name: Upload Playwright Test report
142+
if: always()
143+
uses: actions/upload-artifact@v3
144+
with:
145+
name: glue_lab-playwright-tests
146+
path: |
147+
ui-tests/test-results
148+
ui-tests/playwright-report
149+
150+
check_links:
151+
name: Check Links
152+
runs-on: ubuntu-latest
153+
timeout-minutes: 15
154+
steps:
155+
- uses: actions/checkout@v3
156+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
157+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Upload Distributions
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: glue_lab-releaser-dist-${{ github.run_number }}
29+
path: .jupyter_releaser_checkout/dist
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update Playwright Snapshots
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
13+
14+
update-snapshots:
15+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Configure git to use https
25+
run: git config --global hub.protocol https
26+
27+
- name: Checkout the branch from the PR that triggered the job
28+
run: hub pr checkout ${{ github.event.issue.number }}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Base Setup
33+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
34+
35+
- name: Install dependencies
36+
run: python -m pip install -U "jupyterlab>=4.0.0a34,<5"
37+
38+
- name: Install extension
39+
run: |
40+
set -eux
41+
jlpm
42+
python -m pip install .
43+
44+
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
# Playwright knows how to start JupyterLab server
48+
start_server_script: 'null'
49+
test_folder: ui-tests
50+

0 commit comments

Comments
 (0)