|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + docs: |
| 7 | + name: Documentation |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v1 |
| 11 | + - name: Set up Python |
| 12 | + uses: actions/setup-python@v1 |
| 13 | + with: |
| 14 | + python-version: 3.7 |
| 15 | + - uses: actions/cache@v1 |
| 16 | + with: |
| 17 | + path: ~/.cache/pip |
| 18 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}} |
| 19 | + restore-keys: | |
| 20 | + ${{ runner.os }}-pip- |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + sudo apt-get install -y pandoc |
| 24 | + python -m pip install --upgrade pip |
| 25 | + pip install file://$PWD#egg=ipywidgets |
| 26 | + pip install -r ./docs/requirements.txt |
| 27 | + - name: Build docs |
| 28 | + run: | |
| 29 | + cd docs |
| 30 | + make html |
| 31 | + js: |
| 32 | + name: JavaScript |
| 33 | + runs-on: ubuntu-latest |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v1 |
| 37 | + - name: Use Node.js 10.x |
| 38 | + uses: actions/setup-node@v1 |
| 39 | + with: |
| 40 | + node-version: 10.x |
| 41 | + - name: Install dependencies |
| 42 | + run: | |
| 43 | + sudo apt-get install -y firefox |
| 44 | + - name: Get yarn cache |
| 45 | + id: yarn-cache |
| 46 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 47 | + - uses: actions/cache@v1 |
| 48 | + with: |
| 49 | + path: ${{ steps.yarn-cache.outputs.dir }} |
| 50 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 51 | + restore-keys: | |
| 52 | + ${{ runner.os }}-yarn- |
| 53 | + - name: yarn install, build, test |
| 54 | + run: | |
| 55 | + yarn install --frozen-lockfile |
| 56 | + yarn run build |
| 57 | + yarn run build:examples |
| 58 | +
|
| 59 | + pushd packages/base |
| 60 | + yarn run test:unit:firefox:headless |
| 61 | + popd |
| 62 | +
|
| 63 | + pushd packages/base-manager |
| 64 | + yarn run test:unit:firefox:headless |
| 65 | + popd |
| 66 | +
|
| 67 | + pushd packages/controls |
| 68 | + yarn run test:unit:firefox:headless |
| 69 | + popd |
| 70 | +
|
| 71 | + pushd packages/html-manager |
| 72 | + yarn run test:unit:firefox:headless |
| 73 | + popd |
| 74 | +
|
| 75 | + pushd examples/web1 |
| 76 | + yarn run test:firefox:headless |
| 77 | + popd |
| 78 | +
|
| 79 | + env: |
| 80 | + CI: true |
| 81 | + python: |
| 82 | + name: Python |
| 83 | + runs-on: ubuntu-latest |
| 84 | + strategy: |
| 85 | + max-parallel: 4 |
| 86 | + matrix: |
| 87 | + python-version: [3.5, 3.6, 3.7, 3.8] |
| 88 | + |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v1 |
| 91 | + - name: Set up Python ${{ matrix.python-version }} |
| 92 | + uses: actions/setup-python@v1 |
| 93 | + with: |
| 94 | + python-version: ${{ matrix.python-version }} |
| 95 | + - uses: actions/cache@v1 |
| 96 | + with: |
| 97 | + path: ~/.cache/pip |
| 98 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}} |
| 99 | + restore-keys: | |
| 100 | + ${{ runner.os }}-pip- |
| 101 | + - name: Install dependencies |
| 102 | + run: | |
| 103 | + python -m pip install --upgrade pip |
| 104 | + pip install file://$PWD#egg=ipywidgets[test] |
| 105 | + - name: Test with pytest |
| 106 | + run: | |
| 107 | + pip install pytest |
| 108 | + pytest --cov=ipywidgets ipywidgets |
| 109 | + spec: |
| 110 | + name: Message Specification |
| 111 | + runs-on: ubuntu-latest |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v1 |
| 114 | + - name: Set up Python |
| 115 | + uses: actions/setup-python@v1 |
| 116 | + with: |
| 117 | + python-version: 3.5 |
| 118 | + - uses: actions/cache@v1 |
| 119 | + with: |
| 120 | + path: ~/.cache/pip |
| 121 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}} |
| 122 | + restore-keys: | |
| 123 | + ${{ runner.os }}-pip- |
| 124 | + - name: Install dependencies |
| 125 | + run: | |
| 126 | + python -m pip install --upgrade pip |
| 127 | + pip install file://$PWD#egg=ipywidgets |
| 128 | + - name: Compare spec with latest version |
| 129 | + run: | |
| 130 | + python ./packages/schema/generate-spec.py -f markdown > spec.md |
| 131 | + diff -u ./packages/schema/jupyterwidgetmodels.latest.md ./spec.md |
0 commit comments