Skip to content

Commit 49d80a1

Browse files
committed
YAML modifications.
1 parent 0835c95 commit 49d80a1

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

.github/workflows/Pipeline.yml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: Unit Testing, Coverage Collection, Package, Release, Documentation and Pub
22

33
on: [ push ]
44

5+
env:
6+
PYTHON_LATEST: 3.9
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
512
jobs:
613
UnitTesting:
714
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
@@ -22,7 +29,7 @@ jobs:
2229
python: ${{ env.PYTHON }}
2330

2431
steps:
25-
- name: Checkout repository
32+
- name: Checkout repository
2633
uses: actions/checkout@v2
2734

2835
- name: 🐍 Setup Python ${{ matrix.python }}
@@ -35,7 +42,7 @@ jobs:
3542
python -m pip install --upgrade pip
3643
pip install -r tests/requirements.txt
3744
38-
- name: Run unit tests
45+
- name: Run unit tests
3946
run: |
4047
python -m pytest -rA tests/unit
4148
@@ -44,12 +51,12 @@ jobs:
4451
runs-on: ubuntu-latest
4552

4653
env:
47-
PYTHON: 3.9
54+
PYTHON: ${{ env.PYTHON_LATEST }}
4855
outputs:
4956
python: ${{ env.PYTHON }}
5057

5158
steps:
52-
- name: 🔋 Checkout repository
59+
- name: Checkout repository
5360
uses: actions/checkout@v2
5461

5562
- name: 🐍 Setup Python ${{ env.PYTHON }}
@@ -199,7 +206,7 @@ jobs:
199206
artifact: ${{ env.ARTIFACT }}
200207

201208
steps:
202-
- name: Download artifacts '${{ env.ARTIFACT }}' from 'Package' job
209+
- name: 📥 Download artifacts '${{ env.ARTIFACT }}' from 'Package' job
203210
uses: actions/download-artifact@v2
204211
with:
205212
name: ${{ env.ARTIFACT }}
@@ -223,27 +230,31 @@ jobs:
223230
twine upload dist/*
224231
225232
VerifyDocs:
226-
name: 📓 Verify that example(s) is/are runnable
233+
name: 👍 Verify example snippets
227234
runs-on: ubuntu-latest
228-
steps:
229235

230-
- name: 📥 Checkout repository
236+
env:
237+
PYTHON: ${{ env.PYTHON_LATEST }}
238+
outputs:
239+
python: ${{ env.PYTHON }}
240+
241+
steps:
242+
- name: ⏬ Checkout repository
231243
uses: actions/checkout@v2
232244

233-
- name: '⚙️ Setup GHDL'
245+
- name: Setup GHDL
234246
uses: ghdl/setup-ghdl-ci@master
235247

236-
- name: '🐍 Setup Python'
248+
- name: 🐍 Setup Python
237249
uses: actions/setup-python@v2
238250
with:
239-
python-version: 3.9
251+
python-version: ${{ env.PYTHON }}
240252

241-
- name: '🐍 Install dependencies'
253+
- name: 🐍 Install dependencies
242254
run: |
243-
pip3 install pytest
244255
pip3 install git+https://github.com/ghdl/ghdl.git@$(ghdl version hash)
245-
246-
- name: 'Extract example from README'
256+
257+
- name: Extract code snippet from README
247258
shell: python
248259
run: |
249260
from pathlib import Path
@@ -253,21 +264,21 @@ jobs:
253264
254265
with (ROOT / 'README.md').open('r') as rptr:
255266
content = rptr.read()
256-
267+
257268
m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
258-
269+
259270
if m is None:
260271
raise Exception("Regular expression did not find the example in the README!")
261-
272+
262273
with (ROOT / 'tests/docs/example.py').open('w') as wptr:
263274
wptr.write(m["code"])
264-
265-
- name: 'Print example.py'
266-
run: cat tests/docs/example.py
267275
268-
- name: 'Run example.py'
276+
# - name: Print example.py
277+
# run: cat tests/docs/example.py
278+
279+
- name: ☑ Run example snippet
280+
working-directory: tests/docs
269281
run: |
270-
cd tests/docs
271282
python3 example.py
272283
273284
@@ -277,9 +288,8 @@ jobs:
277288

278289
needs:
279290
- VerifyDocs
280-
281-
steps:
282291

292+
steps:
283293
- name: Checkout repository
284294
uses: actions/checkout@v2
285295

@@ -290,12 +300,12 @@ jobs:
290300
RUN apk add -U --no-cache graphviz
291301
EOF
292302
293-
- name: 🛳️ Build documentation in 'pyVHDLModel/doc'
303+
- name: 🛳️ Build documentation from './pyVHDLModel/doc'
294304
uses: buildthedocs/btd@v0
295305
with:
296306
token: ${{ github.token }}
297307

298-
- name: Upload artifacts to GitHub Pages
308+
- name: 📤 Upload artifacts to GitHub Pages
299309
uses: actions/upload-artifact@master
300310
with:
301311
name: doc

0 commit comments

Comments
 (0)