|
8 | 8 | branches:
|
9 | 9 | - master
|
10 | 10 |
|
11 |
| -jobs: |
| 11 | +defaults: |
12 | 12 | run:
|
| 13 | + shell: bash -l {0} |
| 14 | + |
| 15 | +jobs: |
| 16 | + tests: |
13 | 17 | runs-on: ${{ matrix.os }}
|
14 | 18 |
|
15 | 19 | strategy:
|
16 | 20 | fail-fast: false
|
17 | 21 | matrix:
|
18 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
19 |
| - python-version: [3.6, 3.7, 3.8] |
| 22 | + os: [ubuntu-latest, macos-latest] |
| 23 | + python-version: [3.9] |
20 | 24 |
|
21 | 25 | steps:
|
22 | 26 | - name: Checkout
|
23 | 27 | uses: actions/checkout@v2
|
24 | 28 |
|
25 | 29 | - name: Setup conda
|
26 |
| - uses: s-weigand/setup-conda@v1 |
| 30 | + uses: conda-incubator/setup-miniconda@v2 |
27 | 31 | with:
|
28 |
| - auto-update-conda: true |
29 |
| - update-conda: true |
30 |
| - conda-channels: conda-forge |
| 32 | + activate-environment: ipygany-dev |
| 33 | + environment-file: dev_environment.yml |
| 34 | + python-version: ${{ matrix.python-version }} |
| 35 | + mamba-version: "*" |
| 36 | + auto-activate-base: false |
| 37 | + channels: conda-forge |
31 | 38 |
|
32 |
| - - name: Conda install dependencies |
33 |
| - run: conda install python=${{ matrix.python-version }} pip nodejs=13 ipywidgets jupyter jupyterlab vtk flake8 pytest ipydatawidgets |
| 39 | + - name: Workaround pytest issue |
| 40 | + run: pip install pytest_tornasync |
34 | 41 |
|
35 | 42 | - name: Test flake8
|
36 | 43 | run: flake8 ipygany --ignore=E501
|
37 | 44 |
|
38 | 45 | - name: Install ipygany
|
39 |
| - run: pip install -e . |
| 46 | + run: pip install . |
| 47 | + |
| 48 | + - name: Check installation files |
| 49 | + run: | |
| 50 | + test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipygany |
| 51 | + test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/extension.js |
| 52 | + test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/index.js |
| 53 | + test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany |
| 54 | + test -f $CONDA_PREFIX/share/jupyter/labextensions/ipygany/package.json |
40 | 55 |
|
41 |
| - - name: Install labextension (Only on Ubuntu for build speed) |
42 |
| - if: matrix.os == 'ubuntu-latest' |
43 |
| - run: jupyter labextension install . |
| 56 | + - name: Check nbextension and labextension |
| 57 | + run: | |
| 58 | + jupyter nbextension list 2>&1 | grep -ie "ipygany/extension.*enabled" - |
| 59 | + jupyter labextension list 2>&1 | grep -ie "ipygany.*enabled.*ok" - |
44 | 60 |
|
45 | 61 | - name: Run Python tests
|
46 | 62 | run: pytest tests
|
47 | 63 |
|
48 | 64 | - name: Build docs (Only on MacOS for build speed)
|
49 | 65 | if: matrix.os == 'macos-latest'
|
50 | 66 | run: |
|
51 |
| - conda install sphinx sphinx_rtd_theme pygments==2.6.1 jupyter-sphinx meshpy pyvista |
52 |
| - cd docs/source/ |
53 |
| - sphinx-build . _build/html |
54 |
| - cd ../.. |
| 67 | + mamba install sphinx sphinx_rtd_theme pygments==2.6.1 jupyter-sphinx meshpy pyvista |
| 68 | + cd docs/source/ |
| 69 | + sphinx-build . _build/html |
| 70 | + cd ../.. |
| 71 | +
|
| 72 | + build: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + |
| 76 | + - name: Checkout |
| 77 | + uses: actions/checkout@v2 |
| 78 | + |
| 79 | + - name: Setup conda |
| 80 | + uses: conda-incubator/setup-miniconda@v2 |
| 81 | + with: |
| 82 | + activate-environment: ipygany-dev |
| 83 | + environment-file: dev_environment.yml |
| 84 | + python-version: ${{ matrix.python-version }} |
| 85 | + mamba-version: "*" |
| 86 | + auto-activate-base: false |
| 87 | + channels: conda-forge |
| 88 | + |
| 89 | + - name: Build packages |
| 90 | + run: | |
| 91 | + python setup.py sdist bdist_wheel |
| 92 | + cd dist |
| 93 | + sha256sum * | tee SHA256SUMS |
| 94 | +
|
| 95 | + - name: Upload builds |
| 96 | + uses: actions/upload-artifact@v2 |
| 97 | + with: |
| 98 | + name: dist ${{ github.run_number }} |
| 99 | + path: ./dist |
| 100 | + |
| 101 | + install: |
| 102 | + runs-on: ${{ matrix.os }}-latest |
| 103 | + needs: [build] |
| 104 | + |
| 105 | + strategy: |
| 106 | + fail-fast: false |
| 107 | + matrix: |
| 108 | + os: [ubuntu, macos, windows] |
| 109 | + python: ['3.6', '3.9'] |
| 110 | + include: |
| 111 | + - python: '3.6' |
| 112 | + dist: 'ipygany*.tar.gz' |
| 113 | + - python: '3.9' |
| 114 | + dist: 'ipygany*.whl' |
| 115 | + |
| 116 | + steps: |
| 117 | + |
| 118 | + - name: Checkout |
| 119 | + uses: actions/checkout@v2 |
| 120 | + |
| 121 | + - name: Setup conda |
| 122 | + uses: conda-incubator/setup-miniconda@v2 |
| 123 | + with: |
| 124 | + activate-environment: ipygany-dev |
| 125 | + environment-file: dev_environment.yml |
| 126 | + python-version: ${{ matrix.python-version }} |
| 127 | + mamba-version: "*" |
| 128 | + auto-activate-base: false |
| 129 | + channels: conda-forge |
| 130 | + |
| 131 | + - uses: actions/download-artifact@v2 |
| 132 | + with: |
| 133 | + name: dist ${{ github.run_number }} |
| 134 | + path: ./dist |
| 135 | + |
| 136 | + - name: Install the package |
| 137 | + run: | |
| 138 | + cd dist |
| 139 | + pip install -vv ${{ matrix.dist }} |
| 140 | +
|
| 141 | + - name: Test installation files |
| 142 | + run: | |
| 143 | + test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipygany |
| 144 | + test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/extension.js |
| 145 | + test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/index.js |
| 146 | + test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany |
| 147 | + test -f $CONDA_PREFIX/share/jupyter/labextensions/ipygany/package.json |
| 148 | + test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany/static |
| 149 | +
|
| 150 | + - name: Validate the nbextension |
| 151 | + run: jupyter nbextension list 2>&1 | grep "ipygany/extension" |
| 152 | + |
| 153 | + - name: Validate the labextension |
| 154 | + run: jupyter labextension list 2>&1 | grep ipygany |
0 commit comments