Skip to content

Commit

Permalink
add travis ci testing
Browse files Browse the repository at this point in the history
* and lint tests with shellcheck
  • Loading branch information
msimerson committed Nov 26, 2016
1 parent 510c9ad commit fced859
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions tests/lint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fced859

Please sign in to comment.