From 750b0f28c13e5050df1b0b0b412091c1186037fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 30 Nov 2024 10:59:45 +0000 Subject: [PATCH] ci: add QA for shell scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 3eae968de5d ("tools: add build_firmware.sh providing firmware build functionality") new build_firmware.sh shell script was added, so lets keep the code quality with reviewdog's shfmt and shellcheck based GitHub actions. Signed-off-by: Petr Štetiar --- .github/workflows/shellcheck.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000..00a79987 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,34 @@ +name: reviewdog / shellscripts + +on: + push: + paths: + - tools/build_firmware.sh + + pull_request: + paths: + - tools/build_firmware.sh + +jobs: + + shellcheck: + name: Check shell scripts with shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + reporter: github-pr-review + path: tools + pattern: "*.sh" + + shfmt: + name: Check shell scripts with shfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: reviewdog/action-shfmt@v1 + with: + level: warning + shfmt_flags: '-i 0 ' \ No newline at end of file