Skip to content

Commit e89c240

Browse files
authored
Add Binder on PR workflow (#949)
* Add Binder on PR workflow * Add .binder/ and postBuild * Add .binder to check-manifest ignore
1 parent e85168e commit e89c240

File tree

5 files changed

+40
-3
lines changed

5 files changed

+40
-3
lines changed

environment.yml renamed to .binder/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies:
77
- bqplot
88
- scipy
99
- ipympl
10-
- voila=0.2.11
1110
- ipympl
1211
- xleaflet=0.14.0
1312
- xeus-cling=0.12.1

.binder/postBuild

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
jlpm && jlpm run build
6+
python -m pip install -e .
7+
jupyter labextension develop . --overwrite
8+
jupyter server extension enable voila.server_extension --sys-prefix
9+
jupyter serverextension enable voila.server_extension --sys-prefix

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
2+
name: Binder Badge
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests:
9+
write
10+
11+
jobs:
12+
binder:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: comment on PR with Binder link
16+
uses: actions/github-script@v1
17+
with:
18+
github-token: ${{secrets.GITHUB_TOKEN}}
19+
script: |
20+
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
21+
var PR_HEAD_REF = process.env.PR_HEAD_REF;
22+
github.issues.createComment({
23+
issue_number: context.issue.number,
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=voila/tree) :point_left: Try it on binder (branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_)`
27+
})
28+
env:
29+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
30+
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}

RELEASE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Make sure the `dist/` folder is empty.
4040
3. Bump the version:
4141
- `pip install tbump@git+git://github.com/dmerejkowsky/tbump.git@03988d5d2267ddd4a33b3c4196b05b7f24f0a0a4`
4242
- `tbump x.y.z`
43-
- Update [environment.yml](./environment.yml) with the new version number (see and [example diff](https://github.com/voila-dashboards/voila/commit/5c6fd8dd3ea71412ae9c20c25248453d22a3b60a))
4443
4. `python -m build`
4544
5. Double check the size of the bundles in the `dist/` folder
4645
6. Make sure the JupyterLab extension is correctly bundled in source distribution

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ src = "voila/_version.py"
3434
before-build-npm = ["python -m pip install jupyterlab~=3.0", "jlpm"]
3535

3636
[tool.check-manifest]
37-
ignore = ["docs/**", "notebooks/**", "packages/**", "share/**/*.js", "share/**/*.woff", "*.json", "*.gif", "yarn.lock", "environment.yml", "readthedocs.yml", ".*", "lint-staged.config.js", "voila/labextension/**", "voila/static/**", "tests/**", "ui-tests/**"]
37+
ignore = [".binder/**", "docs/**", "notebooks/**", "packages/**", "share/**/*.js", "share/**/*.woff", "*.json", "*.gif", "yarn.lock", "environment.yml", "readthedocs.yml", ".*", "lint-staged.config.js", "voila/labextension/**", "voila/static/**", "tests/**", "ui-tests/**"]

0 commit comments

Comments
 (0)