From 9185652437bcc88b1ca5ad9981886d63f7abc526 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 2 Jun 2022 16:25:11 +0200 Subject: [PATCH] tests: Fail on CI when any required tool is missing --- .github/workflows/ci.yml | 2 +- tests/Makefile | 6 ++++++ tests/make/test_rules.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea48d06b..67abe1f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,4 +9,4 @@ jobs: - uses: actions/checkout@v2 - uses: YosysHQ/setup-oss-cad-suite@v1 - name: Run checks - run: tabbypip install xmlschema && make ci + run: tabbypip install xmlschema && make ci NOSKIP=1 diff --git a/tests/Makefile b/tests/Makefile index ccb983c2..6b02872d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -31,6 +31,12 @@ make/rules/collect.mk: make/collect_tests.py make/rules/test/%.mk: python3 make/test_rules.py $< +ifdef NOSKIP +SKIP_COMMAND := echo "NOSKIP was set, treating this as an error"; echo; false +else +SKIP_COMMAND := echo +endif + ifneq (help,$(MAKECMDGOALS)) # This should run every time but only trigger anything depending on it whenever diff --git a/tests/make/test_rules.py b/tests/make/test_rules.py index d03fc6c1..4871b11b 100644 --- a/tests/make/test_rules.py +++ b/tests/make/test_rules.py @@ -66,7 +66,7 @@ def parse_engine(engine): if missing_tools: print( - f"\t@echo; echo 'SKIPPING {target}: {', '.join(missing_tools)} not found'; echo", + f"\t@echo; echo 'SKIPPING {target}: {', '.join(missing_tools)} not found'; $(SKIP_COMMAND)", file=rules, )