Skip to content

Commit 342fd5f

Browse files
committed
docs: fix doctests and run them in CI workflow.
1 parent 5d87209 commit 342fd5f

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/main.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
on:
2-
push: {}
3-
pull_request:
4-
types: [opened, reopened, synchronize]
1+
on: [push, pull_request]
52
name: CI
63
jobs:
74
test:
@@ -14,8 +11,14 @@ jobs:
1411
- '3.9'
1512
- '3.10'
1613
- '3.11'
17-
- '3.12-dev'
1814
- 'pypy-3.7-v7.3.3'
15+
allow-failure:
16+
- false
17+
include:
18+
- python-version: '3.12-dev'
19+
allow-failure: true
20+
continue-on-error: '${{ matrix.allow-failure }}'
21+
name: 'test (${{ matrix.python-version }})'
1922
steps:
2023
- name: Check out source code
2124
uses: actions/checkout@v3
@@ -32,8 +35,9 @@ jobs:
3235
sudo apt-get update
3336
sudo apt-get install yices2
3437
pip install coverage codecov
35-
pip install 'yowasp-yosys==0.20.dev398' # latest version that works on Python 3.7
38+
pip install yowasp-yosys==0.20.* # last version compatible with Python 3.7
3639
pip install -e .[builtin-yosys]
40+
pip install -r docs/requirements.txt
3741
- name: Preserve Wasm cache
3842
uses: actions/cache@v3
3943
with:
@@ -47,6 +51,7 @@ jobs:
4751
export PYTHONWARNINGS=error
4852
python -m coverage run -m unittest discover -t . -s tests
4953
unset PYTHONWARNINGS
54+
sphinx-build -b doctest docs/ docs/_build
5055
codecov
5156
document:
5257
runs-on: ubuntu-latest

docs/lang.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ Every signal included in the target of an assignment becomes a part of the domai
800800

801801
Clearly, Amaranth code that drives a single bit of a signal from two different domains does not describe a meaningful circuit. However, driving two different bits of a signal from two different domains does not inherently cause such a conflict. Would Amaranth accept the following code?
802802

803-
.. testcode::
803+
.. code-block::
804804
805805
e = Signal(2)
806806
m.d.comb += e[0].eq(0)
@@ -945,6 +945,7 @@ Signals in the combinatorial :ref:`control domain <lang-domains>` change wheneve
945945
Consider the following code:
946946

947947
.. testsetup::
948+
948949
en = Signal()
949950
b = Signal(8)
950951

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sphinx~=6.1
1+
sphinx~=5.3
22
sphinxcontrib-platformpicker~=1.3
33
sphinx-rtd-theme~=1.2

0 commit comments

Comments
 (0)