Skip to content

Switch to GitHub actions on CI #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build

on:
push:
branches: master
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: '12.x'

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'

- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.7-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.7-
pip-

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: |
python -m pip install -U pip setuptools cookiecutter

- name: Test the extension
# env:
# CHROME_BIN: chromium-browser
run: |
cookiecutter . --config-file tests/testconfig.yaml --no-input
pushd jupyter-widget-testwidgets
python -m pip install --upgrade -v -e ".[test, examples, docs]"
npm run lint:check

# TODO: re-enable tests
# pytest
# npm run test:ci

# - name: Check docs can be build + links
# run: |
# pushd jupyter-widget-testwidgets/docs
# make html
# make linkcheck
# popd

- name: Make a non-local install so the data_files get populated
run: |
pip uninstall -y jupyter_widget_testwidgets
cd jupyter-widget-testwidgets
pip install .
jupyter nbextension enable --py --sys-prefix jupyter_widget_testwidgets
# Validate nbextension (enable does not use exit code):
python -c "from notebook.nbextensions import validate_nbextension; import sys; sys.exit(validate_nbextension('jupyter_widget_testwidgets/extension') or 0)"
pip install jupyterlab
# Make sure our lab extension was installed.
jupyter labextension list 2>&1 | grep -ie "jupyter-widget-testwidgets.*OK"
# Make sure our lab extension can be linked.
jupyter labextension link
Copy link
Contributor

@ianhi ianhi Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the PR for jlab3 we can update this to check if jupyter labextension develop . --overwrite works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes absolutely we can do that in #90

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 400a790

49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"python_package_name": "{{ cookiecutter.github_project_name | replace('-', '_') }}",
"npm_package_name": "{{ cookiecutter.github_project_name }}",
"npm_package_version": "0.1.0",
"project_short_description": "A Custom Jupyter Widget Library"
"project_short_description": "A Custom Jupyter Widget Library",
"_copy_without_render": [
".github/workflows/*"
]
}
62 changes: 62 additions & 0 deletions {{cookiecutter.github_project_name}}/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
branches: main
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'

- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.7-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.7-
pip-

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: |
python -m pip install -U pip setuptools codecov
npm install -g codecov
- name: Test the extension
run: |
python -m pip install --upgrade -v -e ".[test, examples, docs]"
npm run lint:check
pytest
npm run test:ci
- name: Check docs can be build + links
run: |
pushd docs
make html
make linkcheck
popd
python -m pytest_check_links --links-ext=.md -o testpaths=. -o addopts=

74 changes: 0 additions & 74 deletions {{cookiecutter.github_project_name}}/.travis.yml

This file was deleted.

62 changes: 0 additions & 62 deletions {{cookiecutter.github_project_name}}/appveyor.yml

This file was deleted.