Skip to content

Commit 4a3a3f2

Browse files
committed
Streamline install tests
- Cache installs - Remove macos from build matrix (presumably it is similar to ubuntu) - only test ipywidgets wheel on python 3.9
1 parent 70d11df commit 4a3a3f2

File tree

1 file changed

+47
-16
lines changed

1 file changed

+47
-16
lines changed

.github/workflows/packaging.yml

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ jobs:
2828
with:
2929
python-version: '3.9'
3030
architecture: 'x64'
31+
32+
- uses: actions/cache@v2
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
39+
- name: Get yarn cache directory path
40+
id: yarn-cache-dir-path
41+
run: echo "::set-output name=dir::$(yarn cache dir)"
42+
- uses: actions/cache@v2
43+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
44+
with:
45+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-yarn-
49+
3150
- name: Install dependencies
3251
run: |
3352
python -m pip install --upgrade pip wheel
@@ -65,52 +84,64 @@ jobs:
6584
strategy:
6685
fail-fast: false
6786
matrix:
68-
os: [ubuntu, macos, windows]
87+
os: [ubuntu, windows]
6988
python: ['3.6', '3.9']
70-
dist: ['ipywidgets*.tar.gz', 'ipywidgets*.whl']
89+
dist: ['ipywidgets*.tar.gz']
7190
include:
7291
- python: '3.9'
7392
dist: 'jupyterlab_widgets*.tar.gz'
93+
os: 'ubuntu'
7494
- python: '3.9'
7595
dist: 'widgetsnbextension*.tar.gz'
76-
- os: windows
77-
py_cmd: python
78-
- os: macos
79-
py_cmd: python3
80-
- os: ubuntu
81-
py_cmd: python
96+
os: 'ubuntu'
97+
- python: '3.9'
98+
dist: 'ipywidgets*.whl'
99+
os: 'ubuntu'
82100
steps:
83101
- name: Install Python
84102
uses: actions/setup-python@v2
85103
with:
86104
python-version: ${{ matrix.python }}
87105
architecture: 'x64'
106+
107+
- name: Get pip cache dir
108+
id: pip-cache
109+
run: |
110+
echo "::set-output name=dir::$(pip cache dir)"
111+
- name: pip cache
112+
uses: actions/cache@v2
113+
with:
114+
path: ${{ steps.pip-cache.outputs.dir }}
115+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
116+
restore-keys: |
117+
${{ runner.os }}-pip-
118+
119+
- name: Install the prerequisites
120+
run: |
121+
python -m pip install pip wheel
88122
- uses: actions/download-artifact@v2
89123
with:
90124
name: dist ${{ github.run_number }}
91125
path: ./dist
92-
- name: Install the prerequisites
93-
run: |
94-
${{ matrix.py_cmd }} -m pip install pip wheel
95126
- name: Install the package
96127
run: |
97128
cd dist
98-
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
129+
python -m pip install -vv ${{ matrix.dist }}
99130
- name: Validate environment
100131
run: |
101-
${{ matrix.py_cmd }} -m pip freeze
102-
${{ matrix.py_cmd }} -m pip check
132+
python -m pip freeze
133+
python -m pip check
103134
- name: Check the JupyterLab extension is installed
104135
if: matrix.dist != 'widgetsnbextension*.tar.gz'
105136
run: |
106-
${{ matrix.py_cmd }} -m pip install jupyterlab~=3.0
137+
python -m pip install jupyterlab~=3.0
107138
108139
jupyter labextension list
109140
jupyter labextension list 2>&1 | grep -ie "@jupyter-widgets/jupyterlab-manager.*enabled.*ok" -
110141
- name: Check the Classic Notebook extension is installed
111142
if: matrix.dist != 'jupyterlab_widgets*.tar.gz'
112143
run: |
113-
${{ matrix.py_cmd }} -m pip install notebook~=6.0
144+
python -m pip install notebook~=6.0
114145
115146
jupyter nbextension list
116147
jupyter nbextension list 2>&1 | grep -ie "jupyter-js-widgets/extension.*enabled" -

0 commit comments

Comments
 (0)