Przeglądaj źródła

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
bstashio 8 lat temu
rodzic
commit
019df9573e
3 zmienionych plików z 54 dodań i 0 usunięć
  1. 1 0
      .gitignore
  2. 6 0
      .travis.yml
  3. 47 0
      test/sass-compile-tester.sh

+ 1 - 0
.gitignore

@@ -10,3 +10,4 @@ npm-debug.log
 _gh_pages
 _site
 node_modules
+test/output/

+ 6 - 0
.travis.yml

@@ -0,0 +1,6 @@
+script:
+ - "test/sass-compile-tester.sh"
+
+language: sass
+before_install:
+ - gem install sass

+ 47 - 0
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
+# ==============================================================================