|
4 | 4 | push: |
5 | 5 | branches: master |
6 | 6 | pull_request: |
7 | | - branches: '*' |
| 7 | + branches: "*" |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build: |
11 | 11 | runs-on: ubuntu-latest |
12 | 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 | | - yarn 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 | | -
|
78 | | - # Validate nbextension (enable does not use exit code): |
79 | | - jupyter nbextension enable --py --sys-prefix jupyter_widget_testwidgets |
80 | | - python -c "from notebook.nbextensions import validate_nbextension; import sys; sys.exit(validate_nbextension('jupyter_widget_testwidgets/extension') or 0)" |
81 | | -
|
82 | | - # Validate labextension |
83 | | - pip install -U jupyterlab~=3.0 jupyter_packaging~=0.7 |
84 | | - # Make sure our lab extension was installed. |
85 | | - jupyter labextension list 2>&1 | grep -ie "jupyter-widget-testwidgets.*OK" |
86 | | - # Make sure our lab extension can be develop installed. |
87 | | - jupyter labextension develop . --overwrite |
| 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 | + run: | |
| 54 | + cookiecutter . --config-file tests/testconfig.yaml --no-input |
| 55 | + pushd jupyter-widget-testwidgets |
| 56 | + python -m pip install --upgrade -v -e ".[test, examples, docs]" |
| 57 | + yarn run lint:check |
| 58 | +
|
| 59 | + pytest |
| 60 | + yarn run test |
| 61 | + popd |
| 62 | +
|
| 63 | + - name: Check docs can be build + links |
| 64 | + run: | |
| 65 | + sudo apt install -y pandoc |
| 66 | + pushd jupyter-widget-testwidgets/docs |
| 67 | + make html |
| 68 | + python -m pytest --check-links |
| 69 | + popd |
| 70 | +
|
| 71 | + - name: Make a non-local install so the data_files get populated |
| 72 | + run: | |
| 73 | + pip uninstall -y jupyter_widget_testwidgets |
| 74 | + pushd jupyter-widget-testwidgets |
| 75 | +
|
| 76 | + pip install . |
| 77 | +
|
| 78 | + # Validate nbextension (enable does not use exit code): |
| 79 | + jupyter nbextension enable --py --sys-prefix jupyter_widget_testwidgets |
| 80 | + python -c "from notebook.nbextensions import validate_nbextension; import sys; sys.exit(validate_nbextension('jupyter_widget_testwidgets/extension') or 0)" |
| 81 | +
|
| 82 | + # Validate labextension |
| 83 | + pip install -U jupyterlab~=3.0 jupyter_packaging~=0.7 |
| 84 | + # Make sure our lab extension was installed. |
| 85 | + jupyter labextension list 2>&1 | grep -ie "jupyter-widget-testwidgets.*OK" |
| 86 | + # Make sure our lab extension can be develop installed. |
| 87 | + jupyter labextension develop . --overwrite |
| 88 | +
|
| 89 | + popd |
0 commit comments