From 79aacb66c73f9f1681e3dda617e73c8b496a1dc2 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Mon, 9 Nov 2020 17:13:48 -0500 Subject: [PATCH] Add ci-non-go.sh Runs nix-shell based linting and formatting checks. Signed-off-by: Manuel Mendez --- .github/workflows/ci-non-go.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 .github/workflows/ci-non-go.sh diff --git a/.github/workflows/ci-non-go.sh b/.github/workflows/ci-non-go.sh new file mode 100755 index 0000000..026d526 --- /dev/null +++ b/.github/workflows/ci-non-go.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash ../../shell.nix +# shellcheck shell=bash + +set -eux + +failed=0 + +if ! git ls-files '*.md' '*.yaml' '*.yml' | xargs prettier --list-different --write; then + failed=1 +fi + +if ! git ls-files '*.json' | xargs -I '{}' sh -c 'jq --sort-keys . {} > {}.t && mv {}.t {}'; then + failed=1 +fi + +if ! shfmt -f . | xargs shfmt -s -l -d; then + failed=1 +fi + +if ! shfmt -f . | xargs shellcheck; then + failed=1 +fi + +if ! terraform fmt -write -recursive deploy/terraform/; then + failed=1 +fi + +if ! git diff | (! grep .); then + failed=1 +fi + +exit "$failed"