Skip to content

Commit

Permalink
Merge pull request #91 from jtpio/github-actions
Browse files Browse the repository at this point in the history
Switch to GitHub actions on CI
  • Loading branch information
ianhi authored Mar 2, 2021
2 parents 4f15ffa + e186728 commit 78716a6
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 186 deletions.
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
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.

0 comments on commit 78716a6

Please sign in to comment.