Skip to content

Commit 78716a6

Browse files
authored
Merge pull request #91 from jtpio/github-actions
Switch to GitHub actions on CI
2 parents 4f15ffa + e186728 commit 78716a6

File tree

6 files changed

+150
-186
lines changed

6 files changed

+150
-186
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Install node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '12.x'
20+
21+
- name: Install Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.7'
25+
architecture: 'x64'
26+
27+
- name: Setup pip cache
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.cache/pip
31+
key: pip-3.7-${{ hashFiles('package.json') }}
32+
restore-keys: |
33+
pip-3.7-
34+
pip-
35+
36+
- name: Get npm cache directory
37+
id: npm-cache
38+
run: |
39+
echo "::set-output name=dir::$(npm config get cache)"
40+
41+
- uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.npm-cache.outputs.dir }}
44+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-node-
47+
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install -U pip setuptools cookiecutter
51+
52+
- name: Test the extension
53+
# env:
54+
# CHROME_BIN: chromium-browser
55+
run: |
56+
cookiecutter . --config-file tests/testconfig.yaml --no-input
57+
pushd jupyter-widget-testwidgets
58+
python -m pip install --upgrade -v -e ".[test, examples, docs]"
59+
npm run lint:check
60+
61+
# TODO: re-enable tests
62+
# pytest
63+
# npm run test:ci
64+
65+
# - name: Check docs can be build + links
66+
# run: |
67+
# pushd jupyter-widget-testwidgets/docs
68+
# make html
69+
# make linkcheck
70+
# popd
71+
72+
- name: Make a non-local install so the data_files get populated
73+
run: |
74+
pip uninstall -y jupyter_widget_testwidgets
75+
cd jupyter-widget-testwidgets
76+
pip install .
77+
jupyter nbextension enable --py --sys-prefix jupyter_widget_testwidgets
78+
# Validate nbextension (enable does not use exit code):
79+
python -c "from notebook.nbextensions import validate_nbextension; import sys; sys.exit(validate_nbextension('jupyter_widget_testwidgets/extension') or 0)"
80+
pip install jupyterlab
81+
# Make sure our lab extension was installed.
82+
jupyter labextension list 2>&1 | grep -ie "jupyter-widget-testwidgets.*OK"
83+
# Make sure our lab extension can be linked.
84+
jupyter labextension link

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

cookiecutter.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
"python_package_name": "{{ cookiecutter.github_project_name | replace('-', '_') }}",
77
"npm_package_name": "{{ cookiecutter.github_project_name }}",
88
"npm_package_version": "0.1.0",
9-
"project_short_description": "A Custom Jupyter Widget Library"
9+
"project_short_description": "A Custom Jupyter Widget Library",
10+
"_copy_without_render": [
11+
".github/workflows/*"
12+
]
1013
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Install node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: '12.x'
19+
- name: Install Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.7'
23+
architecture: 'x64'
24+
25+
- name: Setup pip cache
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.cache/pip
29+
key: pip-3.7-${{ hashFiles('package.json') }}
30+
restore-keys: |
31+
pip-3.7-
32+
pip-
33+
34+
- name: Get npm cache directory
35+
id: npm-cache
36+
run: |
37+
echo "::set-output name=dir::$(npm config get cache)"
38+
- uses: actions/cache@v2
39+
with:
40+
path: ${{ steps.npm-cache.outputs.dir }}
41+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
42+
restore-keys: |
43+
${{ runner.os }}-node-
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install -U pip setuptools codecov
48+
npm install -g codecov
49+
- name: Test the extension
50+
run: |
51+
python -m pip install --upgrade -v -e ".[test, examples, docs]"
52+
npm run lint:check
53+
pytest
54+
npm run test:ci
55+
- name: Check docs can be build + links
56+
run: |
57+
pushd docs
58+
make html
59+
make linkcheck
60+
popd
61+
python -m pytest_check_links --links-ext=.md -o testpaths=. -o addopts=
62+

{{cookiecutter.github_project_name}}/.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

{{cookiecutter.github_project_name}}/appveyor.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)