From af619c89e52c14bd36be8767832f97b4f369fa42 Mon Sep 17 00:00:00 2001 From: Erik Takke Date: Wed, 18 Mar 2026 12:54:53 +0100 Subject: [PATCH 1/4] spec: have tooling exit(1) on error --- spec/tooling/chip.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/spec/tooling/chip.py b/spec/tooling/chip.py index 688743754..1b1a29ce2 100644 --- a/spec/tooling/chip.py +++ b/spec/tooling/chip.py @@ -1043,6 +1043,7 @@ def check_signatures(found: Iterable[Signature], expected: list[Signature]): signatures = read_signatures(config, sys.argv[2]) if reporter.reported: sys.exit(1) + reported = False chips: list[Chip] = [] for file in sys.argv[3:]: @@ -1050,7 +1051,12 @@ def check_signatures(found: Iterable[Signature], expected: list[Signature]): continue chips.append(Chip.from_file(config, file)) reported |= reporter.reported - if not reported: - for chip in chips: - reporter.update_location(f"Chip {chip.name}") - check_signatures(chip.typecheck(), signatures) + if reported: + sys.exit(1) + + for chip in chips: + reporter.update_location(f"Chip {chip.name}") + check_signatures(chip.typecheck(), signatures) + reported |= reporter.reported + if reported: + sys.exit(1) From 35ac3c2083bbdeec1a90332ae7ec3bb4f8b2ec38 Mon Sep 17 00:00:00 2001 From: Erik Takke Date: Wed, 18 Mar 2026 12:58:51 +0100 Subject: [PATCH 2/4] spec: run spec tooling in CI --- .github/workflows/pr_spec.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pr_spec.yaml diff --git a/.github/workflows/pr_spec.yaml b/.github/workflows/pr_spec.yaml new file mode 100644 index 000000000..08bf81c4b --- /dev/null +++ b/.github/workflows/pr_spec.yaml @@ -0,0 +1,25 @@ +name: Spec tests +on: + pull_request: + branches: + - main + - 'spec/**' + push: + branches: ["**"] + paths: ["spec/**"] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + spec_structure: + name: Spec structure test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + - run: python3 spec/tooling/chip.py spec/src/config.toml spec/src/signatures.toml spec/src/*.toml From b2d9a496e5315c3c725beb0e9d25a0febf04d946 Mon Sep 17 00:00:00 2001 From: Erik Takke Date: Wed, 18 Mar 2026 13:05:53 +0100 Subject: [PATCH 3/4] spec/tooling: verbosely state when no issues are found --- spec/tooling/chip.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/tooling/chip.py b/spec/tooling/chip.py index 1b1a29ce2..15339c10c 100644 --- a/spec/tooling/chip.py +++ b/spec/tooling/chip.py @@ -1060,3 +1060,6 @@ def check_signatures(found: Iterable[Signature], expected: list[Signature]): reported |= reporter.reported if reported: sys.exit(1) + else: + print("No issues were found.") + sys.exit(0) From 93982504bc10df6df8354b9858db8bb4c87da5cf Mon Sep 17 00:00:00 2001 From: Erik Takke Date: Wed, 18 Mar 2026 13:07:50 +0100 Subject: [PATCH 4/4] spec/CI: ignore benchmarks for spec stuff --- .github/workflows/hyperfine.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hyperfine.yaml b/.github/workflows/hyperfine.yaml index f12655d71..e7ef9307e 100644 --- a/.github/workflows/hyperfine.yaml +++ b/.github/workflows/hyperfine.yaml @@ -3,6 +3,7 @@ name: Hyperfine Benchmark on: pull_request: branches: ["**"] + paths-ignore: ["spec/**"] concurrency: group: ${{ github.workflow }}-${{ github.ref }}