about summary refs log tree commit diff
path: root/src/ci/scripts/install-tidy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ci/scripts/install-tidy.sh')
-rwxr-xr-xsrc/ci/scripts/install-tidy.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ci/scripts/install-tidy.sh b/src/ci/scripts/install-tidy.sh
new file mode 100755
index 00000000000..fab126453fd
--- /dev/null
+++ b/src/ci/scripts/install-tidy.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# This script downloads and installs the tidy binary from Homebrew.
+
+set -euo pipefail
+IFS=$'\n\t'
+
+source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
+
+# Only the macOS arm64/aarch64 GitHub Actions runner needs to have tidy
+# installed; other platforms have it preinstalled.
+
+if isMacOS; then
+    platform=$(uname -m)
+    case $platform in
+        x86_64)
+            ;;
+        arm64)
+            brew install tidy-html5
+            ;;
+        *)
+            echo "unsupported architecture: ${platform}"
+            exit 1
+    esac
+fi