From 019df9573ebc5fa9055115cef7391cace105c0cd Mon Sep 17 00:00:00 2001 From: bstashio Date: Fri, 15 Sep 2017 21:34:10 +0300 Subject: [PATCH] Add travis-ci to run tests before merging a PR (#1184) * Add .travis.yml * Add travis tester script * Update .gitignore with test output related directive --- .gitignore | 1 + .travis.yml | 6 +++++ test/sass-compile-tester.sh | 47 +++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .travis.yml create mode 100755 test/sass-compile-tester.sh diff --git a/.gitignore b/.gitignore index 430cf609..2bf50090 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ npm-debug.log _gh_pages _site node_modules +test/output/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..5c64a5a6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +script: + - "test/sass-compile-tester.sh" + +language: sass +before_install: + - gem install sass \ No newline at end of file diff --git a/test/sass-compile-tester.sh b/test/sass-compile-tester.sh new file mode 100755 index 00000000..82450d59 --- /dev/null +++ b/test/sass-compile-tester.sh @@ -0,0 +1,47 @@ +#!/bin/bash + + + +# ============================================================================== +# FUNCTIONS - START +# ============================================================================== + +run_it() +{ + + local _src="${1-bulma.sass}" + local _dest="${2-$(dirname "${BASH_SOURCE[0]}")/output/$(basename ${_src}).css}" + local _options="${3---sourcemap=none}" + + # ---------------------------------------------------------------------------- + + local _dest_dir="$(dirname "${_dest}")" + + if [ ! -d "${_dest_dir}" ]; then + + mkdir -p "${_dest_dir}" + + fi + + # ---------------------------------------------------------------------------- + + sass "${_src}" "${_dest}" ${_options} + +} +# run_it() + +# ============================================================================== +# FUNCTIONS - END +# ============================================================================== + + + +# ============================================================================== +# EXECUTION - START +# ============================================================================== + +run_it $@ + +# ============================================================================== +# EXECUTION - END +# ==============================================================================