Skip to content

Commit

Permalink
Merge pull request #2745 from jasongrout/tests
Browse files Browse the repository at this point in the history
Consolidate test GitHub actions into a single action
  • Loading branch information
jasongrout authored Jan 21, 2020
2 parents 7cb20cd + b907ebf commit e643166
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 143 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Lint
on: [push, pull_request]

jobs:
build:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/testdocs.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/testjs.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/testpython.yml

This file was deleted.

131 changes: 131 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Test

on: [push, pull_request]

jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
python -m pip install --upgrade pip
pip install file://$PWD#egg=ipywidgets
pip install -r ./docs/requirements.txt
- name: Build docs
run: |
cd docs
make html
js:
name: JavaScript
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Install dependencies
run: |
sudo apt-get install -y firefox
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install, build, test
run: |
yarn install --frozen-lockfile
yarn run build
yarn run build:examples
pushd packages/base
yarn run test:unit:firefox:headless
popd
pushd packages/base-manager
yarn run test:unit:firefox:headless
popd
pushd packages/controls
yarn run test:unit:firefox:headless
popd
pushd packages/html-manager
yarn run test:unit:firefox:headless
popd
pushd examples/web1
yarn run test:firefox:headless
popd
env:
CI: true
python:
name: Python
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install file://$PWD#egg=ipywidgets[test]
- name: Test with pytest
run: |
pip install pytest
pytest --cov=ipywidgets ipywidgets
spec:
name: Message Specification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.5
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install file://$PWD#egg=ipywidgets
- name: Compare spec with latest version
run: |
python ./packages/schema/generate-spec.py -f markdown > spec.md
diff -u ./packages/schema/jupyterwidgetmodels.latest.md ./spec.md
27 changes: 0 additions & 27 deletions .github/workflows/testspec.yml

This file was deleted.

0 comments on commit e643166

Please sign in to comment.