|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: '*' |
| 8 | + |
| 9 | +env: |
| 10 | + PIP_DISABLE_PIP_VERSION_CHECK: 1 |
| 11 | + PYTHONUNBUFFERED: 1 |
| 12 | + PYTHONIOENCODING: utf-8 |
| 13 | + |
| 14 | +defaults: |
| 15 | + run: |
| 16 | + shell: bash -l {0} |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + name: build |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + - name: Set up Python |
| 25 | + uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: 3.9 |
| 28 | + - name: Set up Node |
| 29 | + uses: actions/setup-node@v2 |
| 30 | + with: |
| 31 | + node: 14.x |
| 32 | + - name: Install packaging dependencies |
| 33 | + run: | |
| 34 | + set -eux |
| 35 | + python -m pip install -vv -U --user pip wheel setuptools |
| 36 | + yarn --version || npm install -g yarn |
| 37 | + - name: Pre-install node dependencies |
| 38 | + run: | |
| 39 | + set -eux |
| 40 | + cd js |
| 41 | + yarn --ignore-optional |
| 42 | + - name: Build sdist |
| 43 | + run: python setup.py sdist |
| 44 | + - name: Build wheel |
| 45 | + run: python setup.py bdist_wheel |
| 46 | + - name: Collect and hash distributions |
| 47 | + run: | |
| 48 | + set -eux |
| 49 | + cp js/lab-dist/jupyter-threejs-*.tgz dist |
| 50 | + cd dist |
| 51 | + sha256sum * | tee SHA256SUMS |
| 52 | + - name: Upload distributions |
| 53 | + uses: actions/upload-artifact@v2 |
| 54 | + with: |
| 55 | + name: dist ${{ github.run_number }} |
| 56 | + path: ./dist |
| 57 | + |
| 58 | + docs: |
| 59 | + name: docs |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + - name: Install apt dependencies |
| 64 | + run: | |
| 65 | + set -eux |
| 66 | + sudo apt install pandoc |
| 67 | + - name: Set up Python |
| 68 | + uses: actions/setup-python@v2 |
| 69 | + with: |
| 70 | + python-version: 3.9 |
| 71 | + - name: Install packaging dependencies |
| 72 | + run: | |
| 73 | + set -eux |
| 74 | + python -m pip install -vv -U --user pip wheel setuptools |
| 75 | + - name: Set up Node |
| 76 | + uses: actions/setup-node@v2 |
| 77 | + with: |
| 78 | + node: 14.x |
| 79 | + - name: Install package and docs dependencies |
| 80 | + run: | |
| 81 | + set -eux |
| 82 | + pip install -vv -U .[docs,examples,test] requests_cache 'traitlets==4.*' |
| 83 | + - name: Build docs |
| 84 | + run: | |
| 85 | + set -eux |
| 86 | + cd docs |
| 87 | + make html |
| 88 | + - name: Upload docs |
| 89 | + uses: actions/upload-artifact@v2 |
| 90 | + with: |
| 91 | + name: docs ${{ github.run_number }} |
| 92 | + path: ./docs/build |
| 93 | + - name: Cache links |
| 94 | + uses: actions/cache@v1 |
| 95 | + with: |
| 96 | + path: ./build/links |
| 97 | + key: ${{ runner.os }}-links |
| 98 | + - name: Check links |
| 99 | + run: | |
| 100 | + set -eux |
| 101 | + mkdir -p build/links/cache |
| 102 | + cd docs |
| 103 | + pytest-check-links --check-links-cache --check-links-cache-name ../build/links/cache |
| 104 | +
|
| 105 | + test: |
| 106 | + name: test ${{ matrix.os }}${{ matrix.python }} ${{ matrix.node }} ${{ matrix.lab }} |
| 107 | + needs: [build] |
| 108 | + runs-on: ${{ matrix.os }}-latest |
| 109 | + strategy: |
| 110 | + fail-fast: false |
| 111 | + matrix: |
| 112 | + os: [ubuntu, macos, windows] |
| 113 | + python: [3.6, 3.8, 3.9] |
| 114 | + include: |
| 115 | + - python: 3.6 |
| 116 | + dist: 'pythreejs*.tar.gz' |
| 117 | + - python: 3.8 |
| 118 | + dist: 'pythreejs*.whl' |
| 119 | + lab: 1 |
| 120 | + node: 10 |
| 121 | + - python: 3.9 |
| 122 | + dist: 'pythreejs*.whl' |
| 123 | + lab: 2 |
| 124 | + node: 14 |
| 125 | + - os: windows |
| 126 | + py_cmd: python |
| 127 | + - os: macos |
| 128 | + py_cmd: python3 |
| 129 | + - os: ubuntu |
| 130 | + py_cmd: python |
| 131 | + steps: |
| 132 | + - uses: actions/checkout@v2 |
| 133 | + - name: Set up Python |
| 134 | + uses: actions/setup-python@v2 |
| 135 | + with: |
| 136 | + python-version: 3.8 |
| 137 | + - uses: actions/download-artifact@v2 |
| 138 | + with: |
| 139 | + name: dist ${{ github.run_number }} |
| 140 | + path: ./dist |
| 141 | + - name: Install installation dependencies |
| 142 | + run: | |
| 143 | + set -eux |
| 144 | + ${{ matrix.py_cmd }} -m pip install -vv --user -U pip wheel setuptools |
| 145 | + - name: Install package (maybe lab) |
| 146 | + run: | |
| 147 | + set -eux |
| 148 | + cd dist |
| 149 | + ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} |
| 150 | + - name: Validate environment |
| 151 | + run: | |
| 152 | + set -eux |
| 153 | + ${{ matrix.py_cmd }} -m pip freeze |
| 154 | + ${{ matrix.py_cmd }} -m pip check |
| 155 | + - if: ${{ matrix.lab }} |
| 156 | + name: Install lab |
| 157 | + run: | |
| 158 | + set -eux |
| 159 | + ${{ matrix.py_cmd }} -m pip install -vv 'jupyterlab==${{ matrix.lab }}.*' |
| 160 | + - name: Install test dependencies |
| 161 | + # explicit file installs don't support extras, skimage brings most along |
| 162 | + run: | |
| 163 | + set -eux |
| 164 | + ${{ matrix.py_cmd }} -m pip install -vv nbval scikit-image ipywebrtc |
| 165 | + - name: Run python tests |
| 166 | + # remove the source directory to avoid surprises |
| 167 | + run: | |
| 168 | + set -eux |
| 169 | + rm -rf pythreejs |
| 170 | + ${{ matrix.py_cmd }} -m pytest -vv -l --nbval-lax --current-env . |
| 171 | + - name: Check nbextension |
| 172 | + run: | |
| 173 | + set -eux |
| 174 | + jupyter nbextension list |
| 175 | + jupyter nbextension list 2>&1 | grep -ie "jupyter-threejs/extension.*enabled" - |
| 176 | + - if: ${{ matrix.node }} |
| 177 | + name: Set up Node |
| 178 | + uses: actions/setup-node@v2 |
| 179 | + with: |
| 180 | + node: ${{ matrix.node }} |
| 181 | + - if: ${{ matrix.node }} |
| 182 | + name: Install labextension |
| 183 | + run: | |
| 184 | + set -eux |
| 185 | + jupyter labextension install --no-build --debug ./dist/*.tgz @jupyter-widgets/jupyterlab-manager |
| 186 | + jupyter labextension list |
| 187 | + jupyter labextension list 2>&1 | grep -ie "jupyter-threejs" - |
| 188 | + - if: ${{ matrix.node }} |
| 189 | + name: Build lab |
| 190 | + run: | |
| 191 | + set -eux |
| 192 | + jupyter lab build --debug |
| 193 | + - if: ${{ matrix.lab }} |
| 194 | + name: Check labextension |
| 195 | + run: | |
| 196 | + set -eux |
| 197 | + jupyter labextension list |
| 198 | + jupyter labextension list 2>&1 | grep -ie "jupyter-threejs.*enabled.*ok" - |
0 commit comments