tests: Fail on CI when any required tool is missing
authorJannis Harder <me@jix.one>
Thu, 2 Jun 2022 14:25:11 +0000 (16:25 +0200)
committerJannis Harder <me@jix.one>
Thu, 2 Jun 2022 14:38:21 +0000 (16:38 +0200)
.github/workflows/ci.yml
tests/Makefile
tests/make/test_rules.py

index ea48d06bb739c4286002b29f27fa51957f720003..67abe1f67d5e6a4108b39a24395c64cebde5f176 100644 (file)
@@ -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
index ccb983c22097af44a07de20a5678c3ab5c1d6212..6b02872dd437210f6db7f7d2c616fd022e912a88 100644 (file)
@@ -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
index d03fc6c19c2de53d5aed5c72e1a99b527568421e..4871b11b41f912b825b115e5e050d5b5905fc540 100644 (file)
@@ -66,7 +66,7 @@ with rules_file.open("w") as rules:
 
         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,
             )