Skip to content

Commit 3500cc7

Browse files
author
Dou Du
committed
add all files for jlab4
1 parent 6b5177f commit 3500cc7

37 files changed

+1435
-0
lines changed

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

+16
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

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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.0,<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+
jupyter labextension list
40+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_hide_code.*OK"
41+
python -m jupyterlab.browser_check
42+
43+
- name: Package the extension
44+
run: |
45+
set -eux
46+
47+
pip install build
48+
python -m build
49+
pip uninstall -y "jupyterlab_hide_code" jupyterlab
50+
51+
- name: Upload extension packages
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: extension-artifacts
55+
path: dist/jupyterlab_hide_code*
56+
if-no-files-found: error
57+
58+
test_isolated:
59+
needs: build
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Install Python
64+
uses: actions/setup-python@v4
65+
with:
66+
python-version: '3.9'
67+
architecture: 'x64'
68+
- uses: actions/download-artifact@v3
69+
with:
70+
name: extension-artifacts
71+
- name: Install and Test
72+
run: |
73+
set -eux
74+
# Remove NodeJS, twice to take care of system and locally installed node versions.
75+
sudo rm -rf $(which node)
76+
sudo rm -rf $(which node)
77+
78+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_hide_code*.whl
79+
80+
81+
jupyter labextension list
82+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_hide_code.*OK"
83+
python -m jupyterlab.browser_check --no-browser-test
84+
85+
integration-tests:
86+
name: Integration tests
87+
needs: build
88+
runs-on: ubuntu-latest
89+
90+
env:
91+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v3
96+
97+
- name: Base Setup
98+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
99+
100+
- name: Download extension package
101+
uses: actions/download-artifact@v3
102+
with:
103+
name: extension-artifacts
104+
105+
- name: Install the extension
106+
run: |
107+
set -eux
108+
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_hide_code*.whl
109+
110+
- name: Install dependencies
111+
working-directory: ui-tests
112+
env:
113+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
114+
run: jlpm install
115+
116+
- name: Set up browser cache
117+
uses: actions/cache@v3
118+
with:
119+
path: |
120+
${{ github.workspace }}/pw-browsers
121+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
122+
123+
- name: Install browser
124+
run: jlpm playwright install chromium
125+
working-directory: ui-tests
126+
127+
- name: Execute integration tests
128+
working-directory: ui-tests
129+
run: |
130+
jlpm playwright test
131+
132+
- name: Upload Playwright Test report
133+
if: always()
134+
uses: actions/upload-artifact@v3
135+
with:
136+
name: jupyterlab_hide_code-playwright-tests
137+
path: |
138+
ui-tests/test-results
139+
ui-tests/playwright-report
140+
141+
check_links:
142+
name: Check Links
143+
runs-on: ubuntu-latest
144+
timeout-minutes: 15
145+
steps:
146+
- uses: actions/checkout@v3
147+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
148+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

+29
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: jupyterlab_hide_code-releaser-dist-${{ github.run_number }}
29+
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-label.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- name: enforce-triage-label
13+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/prep-release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
target: ${{ github.event.inputs.target }}
36+
branch: ${{ github.event.inputs.branch }}
37+
since: ${{ github.event.inputs.since }}
38+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
39+
40+
- name: "** Next Step **"
41+
run: |
42+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
21+
- name: Populate Release
22+
id: populate-release
23+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
24+
with:
25+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
26+
target: ${{ github.event.inputs.target }}
27+
branch: ${{ github.event.inputs.branch }}
28+
release_url: ${{ github.event.inputs.release_url }}
29+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
30+
31+
- name: Finalize Release
32+
id: finalize-release
33+
env:
34+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
35+
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
36+
TWINE_USERNAME: __token__
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
39+
with:
40+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
41+
target: ${{ github.event.inputs.target }}
42+
release_url: ${{ steps.populate-release.outputs.release_url }}
43+
44+
- name: "** Next Step **"
45+
if: ${{ success() }}
46+
run: |
47+
echo "Verify the final release"
48+
echo ${{ steps.finalize-release.outputs.release_url }}
49+
50+
- name: "** Failure Message **"
51+
if: ${{ failure() }}
52+
run: |
53+
echo "Failed to Publish the Draft Release Url:"
54+
echo ${{ steps.populate-release.outputs.release_url }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
update-snapshots:
13+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }}
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Configure git to use https
23+
run: git config --global hub.protocol https
24+
25+
- name: Checkout the branch from the PR that triggered the job
26+
run: hub pr checkout ${{ github.event.issue.number }}
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Base Setup
31+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
32+
33+
- name: Install dependencies
34+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
35+
36+
- name: Install extension
37+
run: |
38+
set -eux
39+
jlpm
40+
python -m pip install .
41+
42+
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
# Playwright knows how to start JupyterLab server
46+
start_server_script: 'null'
47+
test_folder: ui-tests

0 commit comments

Comments
 (0)