From fced859b3de398bd0d7c6f12bf2bf0c26b818ff1 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sat, 24 Sep 2016 12:41:40 -0700 Subject: [PATCH] add travis ci testing * and lint tests with shellcheck --- .travis.yml | 28 ++++++++++++++++++++++++++++ tests/lint.sh | 15 +++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .travis.yml create mode 100755 tests/lint.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6388933 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: bash + +addons: + apt: + sources: + - debian-sid + packages: + - shellcheck + +cache: + directories: + - /home/travis/.stack + +before_install: + +install: + - test -f tests/lint.sh + - test -f tests/run.sh + +before_script: + +script: + - tests/lint.sh + - cd tests && ./run.sh + +after_script: + +sudo: false diff --git a/tests/lint.sh b/tests/lint.sh new file mode 100755 index 0000000..2713b9e --- /dev/null +++ b/tests/lint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +export DIRS_WITH_SCRIPTS="periodic sbin share/zfsnap share/zfsnap/commands tools" + +pwd + +for _dir in $DIRS_WITH_SCRIPTS +do + for _f in $_dir/*.sh + do + sh -n "$_f" + echo "shellcheck $_f" + shellcheck -e SC2009,SC2086,SC2153,SC2016,SC1004,SC2119 "$_f" + done +done