From 15398d1bdcff6d6c4217cc24198b546a0211491b Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Mon, 15 Jul 2024 10:50:11 +0200 Subject: [PATCH] Add checkbashisms and shellcheck as part of CI --- .github/workflows/ii_wrapper.yml | 9 +++++++++ ci/run-checkbashisms.sh | 6 ++++++ ci/run-shellcheck.sh | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100755 ci/run-checkbashisms.sh create mode 100755 ci/run-shellcheck.sh diff --git a/.github/workflows/ii_wrapper.yml b/.github/workflows/ii_wrapper.yml index 4be6950..919905c 100644 --- a/.github/workflows/ii_wrapper.yml +++ b/.github/workflows/ii_wrapper.yml @@ -9,6 +9,15 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: awalsh128/cache-apt-pkgs-action@v1.4.2 + with: + packages: devscripts shellcheck + - name: Run checkbashisms + run: | + ./ci/run-checkbashisms.sh + - name: Run shellcheck + run: | + ./ci/run-shellcheck.sh - name: Set up Python 3.11 uses: actions/setup-python@v5 with: diff --git a/ci/run-checkbashisms.sh b/ci/run-checkbashisms.sh new file mode 100755 index 0000000..efb8936 --- /dev/null +++ b/ci/run-checkbashisms.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e +set -u + +find . \( -name '*.sh' -or -name iibot-ng \) -print0 | \ + xargs -0 -- checkbashisms --newline --force --lint --extra diff --git a/ci/run-shellcheck.sh b/ci/run-shellcheck.sh new file mode 100755 index 0000000..4831bf2 --- /dev/null +++ b/ci/run-shellcheck.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e +set -u + +find . \( -name '*.sh' -or -name iibot-ng \) -print0 | \ + xargs -0 -- shellcheck