33
33
steps :
34
34
- name : Checkout
35
35
uses : actions/checkout@v2
36
+ - name : Path filter
37
+ id : filter
38
+ uses : dorny/paths-filter@v2
39
+ with :
40
+ filters : |
41
+ extension:
42
+ - '${{ matrix.example }}/**'
36
43
- name : Cache lerna
44
+ if : steps.filter.outputs.extension == 'true'
37
45
uses : actions/cache@v2
38
46
with :
39
47
path : |
43
51
restore-keys : |
44
52
${{ runner.os }}-lerna-
45
53
- name : Check config files
54
+ if : steps.filter.outputs.extension == 'true'
46
55
run : |
47
56
diff basics/hello-world/tsconfig.json ${EXAMPLE_FOLDER}/tsconfig.json
48
57
diff basics/hello-world/.eslintignore ${EXAMPLE_FOLDER}/.eslintignore
@@ -52,46 +61,54 @@ jobs:
52
61
EXAMPLE_FOLDER : ${{ matrix.example }}
53
62
shell : bash
54
63
- name : Install node
64
+ if : steps.filter.outputs.extension == 'true'
55
65
uses : actions/setup-node@v1
56
66
with :
57
67
node-version : " 12.x"
58
68
- name : Install Python
69
+ if : steps.filter.outputs.extension == 'true'
59
70
uses : actions/setup-python@v1
60
71
with :
61
72
python-version : " 3.7"
62
73
architecture : " x64"
63
74
- name : Get pip cache dir
75
+ if : steps.filter.outputs.extension == 'true'
64
76
id : pip-cache
65
77
run : |
66
78
echo "::set-output name=dir::$(pip cache dir)"
67
79
shell : bash
68
80
- name : Cache pip
81
+ if : steps.filter.outputs.extension == 'true'
69
82
uses : actions/cache@v2
70
83
with :
71
84
path : ${{ steps.pip-cache.outputs.dir }}
72
85
key : ${{ runner.os }}-pip-${{ hashFiles('**/environment.yml') }}
73
86
restore-keys : |
74
87
${{ runner.os }}-pip-
75
88
- name : Install the Python dependencies
89
+ if : steps.filter.outputs.extension == 'true'
76
90
run : |
77
91
python -m pip install --upgrade pip
78
92
python -m pip install jupyter_packaging
79
93
python -m pip install --pre jupyterlab
80
94
- name : Install the NPM dependencies
95
+ if : steps.filter.outputs.extension == 'true'
81
96
run : |
82
97
cd ${EXAMPLE_FOLDER}
83
98
jlpm
84
99
env :
85
100
EXAMPLE_FOLDER : ${{ matrix.example }}
86
101
shell : bash
87
102
- name : Lint the files
103
+ if : steps.filter.outputs.extension == 'true'
88
104
run : |
89
105
cd ${EXAMPLE_FOLDER}
90
106
jlpm run eslint:check
91
107
env :
92
108
EXAMPLE_FOLDER : ${{ matrix.example }}
93
109
shell : bash
94
110
- name : Build and check by extension
111
+ if : steps.filter.outputs.extension == 'true'
95
112
run : |
96
113
cd ${EXAMPLE_FOLDER}
97
114
pip install -e .
@@ -113,82 +130,101 @@ jobs:
113
130
steps :
114
131
- name : Checkout
115
132
uses : actions/checkout@v2
133
+ - name : Path filter
134
+ id : filter
135
+ uses : dorny/paths-filter@v2
136
+ with :
137
+ filters : |
138
+ extension:
139
+ - 'advanced/server-extension/**'
116
140
- name : Cache lerna
141
+ if : steps.filter.outputs.extension == 'true'
117
142
uses : actions/cache@v2
118
143
with :
119
144
path : |
120
145
node_modules
121
146
*/*/node_modules
122
- key : ${{ runner.os }}-lerna-${{ hashFiles('** /package.json') }}
147
+ key : ${{ runner.os }}-lerna-${{ hashFiles('advanced/server-extension /package.json') }}
123
148
restore-keys : |
124
149
${{ runner.os }}-lerna-
125
150
- name : Install node
151
+ if : steps.filter.outputs.extension == 'true'
126
152
uses : actions/setup-node@v1
127
153
with :
128
154
node-version : " 12.x"
129
155
- name : Check config files
156
+ if : steps.filter.outputs.extension == 'true'
130
157
run : |
131
158
diff basics/hello-world/tsconfig.json advanced/server-extension/tsconfig.json
132
159
diff basics/hello-world/.eslintignore advanced/server-extension/.eslintignore
133
160
diff basics/hello-world/.eslintrc.js advanced/server-extension/.eslintrc.js
134
161
shell : bash
135
162
- name : Install Python
163
+ if : steps.filter.outputs.extension == 'true'
136
164
uses : actions/setup-python@v1
137
165
with :
138
166
python-version : " 3.7"
139
167
architecture : " x64"
140
168
- name : Get pip cache dir
169
+ if : steps.filter.outputs.extension == 'true'
141
170
id : pip-cache
142
171
run : |
143
172
echo "::set-output name=dir::$(pip cache dir)"
144
173
shell : bash
145
174
- name : Cache pip
175
+ if : steps.filter.outputs.extension == 'true'
146
176
uses : actions/cache@v2
147
177
with :
148
178
path : ${{ steps.pip-cache.outputs.dir }}
149
179
key : ${{ runner.os }}-pip-${{ hashFiles('**/environment.yml') }}
150
180
restore-keys : |
151
181
${{ runner.os }}-pip-
152
182
- name : Install the Python dependencies
183
+ if : steps.filter.outputs.extension == 'true'
153
184
run : |
154
185
python -m pip install --upgrade pip
155
186
python -m pip install jupyter_packaging
156
187
python -m pip install --pre jupyterlab
157
188
- name : Install the NPM dependencies
189
+ if : steps.filter.outputs.extension == 'true'
158
190
run : |
159
191
cd advanced/server-extension
160
192
jlpm
161
193
- name : Lint the files
194
+ if : steps.filter.outputs.extension == 'true'
162
195
run : |
163
196
cd advanced/server-extension
164
197
jlpm run eslint:check
165
198
- name : Build extension as user
199
+ if : steps.filter.outputs.extension == 'true'
166
200
# Force the usage of the source distribution (good practice)
167
201
run : |
168
202
cd advanced/server-extension
169
203
python setup.py sdist
170
204
pip install jlab_ext_example --pre --find-links=dist --no-cache-dir
171
205
python -m jupyterlab.browser_check
172
206
- name : Check extension as dev
173
- if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
207
+ if : steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
174
208
run : |
175
209
jupyter server extension list 1>serverextensions 2>&1
176
210
cat serverextensions | grep "jlab_ext_example.*OK"
177
211
jupyter labextension list 1>labextensions 2>&1
178
212
cat labextensions | grep "@jupyterlab-examples/server-extension.*OK"
179
213
- name : Clean extension installation
214
+ if : steps.filter.outputs.extension == 'true'
180
215
run : |
181
216
pip uninstall -y jlab_ext_example
182
217
jupyter lab clean
183
218
jupyter server extension list
184
219
jupyter labextension list
185
220
- name : Build extension as dev
221
+ if : steps.filter.outputs.extension == 'true'
186
222
run : |
187
223
cd advanced/server-extension
188
224
pip install -e .
189
225
jupyter server extension enable --py jlab_ext_example
190
226
- name : Check extension as dev
191
- if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
227
+ if : steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
192
228
run : |
193
229
jupyter server extension list 1>serverextensions 2>&1
194
230
cat serverextensions | grep "jlab_ext_example.*OK"
0 commit comments