Add formatting job to CI
Signed-off-by: Rafal Kapuscik <rkapuscik@antmicro.com>
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 24a3f80..c2b0f9b 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -78,6 +78,10 @@
- bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check formatting on header guards
+ - bash: ci/scripts/verible-format.sh
+ condition: eq(variables['Build.Reason'], 'PullRequest')
+ displayName: Check formatting of files on allow list with Verible
+ continueOnError: true
- bash: ci/scripts/verible-lint.sh rtl
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Style-Lint RTL Verilog source files with Verible
diff --git a/ci/jobs/quick-lint.sh b/ci/jobs/quick-lint.sh
index d314f05..771a148 100755
--- a/ci/jobs/quick-lint.sh
+++ b/ci/jobs/quick-lint.sh
@@ -56,6 +56,10 @@
echo -e "\n### Check formatting on header guards"
ci/scripts/include-guard.sh $tgt_branch
+echo -e "\n### Check formatting of files on allow list with Verible"
+# This script is allowed to fail for now
+ci/scripts/verible-format.sh || true
+
echo -e "\n### Style-Lint RTL Verilog source files with Verible"
ci/scripts/verible-lint.sh rtl
diff --git a/ci/scripts/verible-format.sh b/ci/scripts/verible-format.sh
new file mode 100755
index 0000000..bfb68cb
--- /dev/null
+++ b/ci/scripts/verible-format.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+
+# A wrapper around Verible format, used for CI.
+
+set -e
+
+util/verible-format.sh || {
+ echo -n "##vso[task.logissue type=error]"
+ echo "Verilog format with Verible failed. Run 'util/verible-format.sh' to check and fix all errors."
+ echo "This flow is currently experimental and failures can be ignored."
+ exit 1
+}