11name : CI
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [main, develop]
67 pull_request :
1112
1213jobs :
1314 lint :
14- name : Lint
15+ name : Python Checks
1516 runs-on : ubuntu-latest
1617 steps :
1718 - name : Checkout
@@ -22,17 +23,26 @@ jobs:
2223 with :
2324 python-version : " 3.11"
2425
25- - name : Install linting tools
26- run : pip install ruff black mypy
26+ - name : Install Python check deps
27+ run : python -m pip install pyyaml
2728
28- - name : Run Ruff
29- run : ruff check .
29+ - name : Validate cross-platform wheel tag helper
30+ run : |
31+ python packaging/wheel/get_wheel_plat_name.py --system linux --arch x86_64
32+ python packaging/wheel/get_wheel_plat_name.py --system macos --arch arm64
33+ python packaging/wheel/get_wheel_plat_name.py --system macos --arch x86_64
3034
31- - name : Run Black
32- run : black --check .
35+ - name : Byte-compile packaging + CLI modules
36+ run : |
37+ python -m py_compile \
38+ packaging/wheel/create_wheel.py \
39+ packaging/wheel/get_wheel_plat_name.py \
40+ packaging/wheel/platform_tags.py \
41+ compiler/frontend/pycircuit/packaged_toolchain.py \
42+ compiler/frontend/pycircuit/cli.py
3343
34- - name : Run MyPy
35- run : mypy compiler/frontend/pycircuit || true
44+ - name : Run API hygiene gate
45+ run : python flows/tools/check_api_hygiene.py compiler/frontend/pycircuit designs/examples docs README.md
3646
3747 build-linux :
3848 name : Build Toolchain (Linux)
7484 --install-dir "$PWD/.pycircuit_out/toolchain/install" \
7585 --out-dir "$PWD/dist"
7686
87+ - name : Run examples
88+ run : |
89+ export PYC_TOOLCHAIN_ROOT="$PWD/.pycircuit_out/toolchain/install"
90+ export PATH="$PYC_TOOLCHAIN_ROOT/bin:$PATH"
91+ export PYC_SKIP_SEMANTIC_REGRESSIONS=1
92+ unset PYCC
93+ bash flows/scripts/run_examples.sh
94+
7795 - name : Upload toolchain
7896 uses : actions/upload-artifact@v4
7997 with :
@@ -88,44 +106,6 @@ jobs:
88106 path : dist/*.whl
89107 retention-days : 1
90108
91- examples-linux :
92- name : Examples + Sims (Linux)
93- runs-on : ubuntu-latest
94- needs : build-linux
95- steps :
96- - name : Checkout
97- uses : actions/checkout@v4
98-
99- - name : Set up Python
100- uses : actions/setup-python@v5
101- with :
102- python-version : " 3.11"
103-
104- - name : Install simulation deps
105- run : |
106- sudo apt-get update
107- sudo apt-get install -y verilator iverilog
108-
109- - name : Download toolchain
110- uses : actions/download-artifact@v4
111- with :
112- name : pyc-toolchain-linux
113- path : .pycircuit_out/toolchain/install
114-
115- - name : Run examples
116- run : |
117- export PYC_TOOLCHAIN_ROOT="$PWD/.pycircuit_out/toolchain/install"
118- export PATH="$PYC_TOOLCHAIN_ROOT/bin:$PATH"
119- unset PYCC
120- bash flows/scripts/run_examples.sh
121-
122- - name : Run simulations
123- run : |
124- export PYC_TOOLCHAIN_ROOT="$PWD/.pycircuit_out/toolchain/install"
125- export PATH="$PYC_TOOLCHAIN_ROOT/bin:$PATH"
126- unset PYCC
127- bash flows/scripts/run_sims.sh
128-
129109 wheel-linux :
130110 name : Wheel Smoke (Linux)
131111 runs-on : ubuntu-latest
@@ -159,6 +139,7 @@ jobs:
159139 pip install dist/*.whl
160140 export PYC_TOOLCHAIN_ROOT="$(python -c 'import pycircuit, pathlib; print((pathlib.Path(pycircuit.__file__).resolve().parent / "_toolchain").as_posix())')"
161141 export PYC_USE_INSTALLED_PYTHON_PACKAGE=1
142+ export PYC_SKIP_SEMANTIC_REGRESSIONS=1
162143 unset PYCC
163144 bash flows/scripts/run_examples.sh
164145
@@ -193,16 +174,15 @@ jobs:
193174
194175 - name : Build platform wheel
195176 run : |
196- python packaging/wheel/get_macos_wheel_plat_name.py "$(uname -m)" > .pycircuit_out/macos_plat_name.txt
197177 python packaging/wheel/create_wheel.py \
198178 --install-dir "$PWD/.pycircuit_out/toolchain/install" \
199- --out-dir "$PWD/dist" \
200- --wheel-plat-name "$(cat .pycircuit_out/macos_plat_name.txt)"
179+ --out-dir "$PWD/dist"
201180
202181 - name : Run example compile gate
203182 run : |
204183 export PYC_TOOLCHAIN_ROOT="$PWD/.pycircuit_out/toolchain/install"
205184 export PATH="$PYC_TOOLCHAIN_ROOT/bin:$PATH"
185+ export PYC_SKIP_SEMANTIC_REGRESSIONS=1
206186 unset PYCC
207187 bash flows/scripts/run_examples.sh
208188
@@ -215,6 +195,7 @@ jobs:
215195 pip install dist/*.whl
216196 export PYC_TOOLCHAIN_ROOT="$(python -c 'import pycircuit, pathlib; print((pathlib.Path(pycircuit.__file__).resolve().parent / "_toolchain").as_posix())')"
217197 export PYC_USE_INSTALLED_PYTHON_PACKAGE=1
198+ export PYC_SKIP_SEMANTIC_REGRESSIONS=1
218199 unset PYCC
219200 bash flows/scripts/run_examples.sh
220201
0 commit comments