Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: Updated Travis CI configuration #754

Merged
merged 1 commit into from Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
@@ -1,8 +1,13 @@
language: bash
install:
- ./ci/install.sh
sudo: false

addons:
apt:
sources:
- debian-sid
packages:
- shellcheck
script:
- ./ci/build.sh
notifications:
email: false
sudo: required
20 changes: 13 additions & 7 deletions ci/build.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail
set -o pipefail
[[ "${DEBUG:-}" ]] && set -x

declare -i failed
Expand All @@ -16,30 +16,36 @@ fail() {

check() {
local script="$1"
shellcheck "$script" || fail "$script"
success "$script"
if shellcheck "$script"; then
success "$script"
else
fail "$script"
fi
}

find_prunes() {
local prunes="! -path './.git/*'"
if [ -f .gitmodules ]; then
while read module; do
while read -r module; do
prunes="$prunes ! -path './$module/*'"
done < <(grep path .gitmodules | awk '{print $3}')
fi
echo "$prunes"
}

find_cmd() {
echo "find . -type f -and \( -perm +111 -or -name '*.sh' \) $(find_prunes)"
echo "find . -type f -and \( -perm /111 -or -name '*.sh' \) $(find_prunes)"
}

check_all_executables() {
echo "Checking executables and .sh files..."
eval "$(find_cmd)" | while read script; do
while read -r script; do
head=$(head -n1 "$script")
[[ "$head" =~ .*ruby.* ]] && continue
[[ "$head" =~ .*zsh.* ]] && continue
[[ "$head" =~ ^#compdef.* ]] && continue
check "$script"
done
done < <(eval "$(find_cmd)")
exit $failed
}

Expand Down
10 changes: 0 additions & 10 deletions ci/install.sh

This file was deleted.