From 49a0723a0918c27b67090c94d1a8cc5b37119284 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Jul 2019 16:42:56 +0200 Subject: [PATCH] [gitlab] Add simple CI pipeline for SH/ZSH scripts --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..95ce8b2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +# This file is a template, and might need editing before it works on your project. +# see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options + +# you can delete this line if you're not using Docker +image: fnichol/check-shell:latest + +shellcheck: + stage: test + before_script: + - shellcheck --version + script: + - echo "######### CHECKING POSIX SHELLSCRIPTS ###########" + - find . -type f -name '*.sh' | xargs shellcheck + - echo "######### CHECKING ZSH SHELLSCRIPTS ###########" + - find . -type f -name '*.zsh' | xargs shellcheck + +shfmt: + stage: test + before_script: + - shfmt -version + script: + - echo "######### CHECKING POSIX FORMATTING ###########" + - find . -type f -name '*.sh' | xargs shfmt -d -i 2 + - echo "######### CHECKING ZSH FORMATTING ###########" + - find . -type f -name '*.zsh' | xargs shfmt -d -i 2