From e3fc944709cf47fb0fa5c262713175008453ab02 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Mon, 13 Feb 2017 07:28:48 +1100 Subject: [PATCH] Added travis config --- .travis.yml | 4 ++++ ci.sh | 14 ++++++++++++++ precheckin.sh | 12 +----------- 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 .travis.yml create mode 100755 ci.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..632989cb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: go +go: + - 1.7.x +script: ./ci.sh \ No newline at end of file diff --git a/ci.sh b/ci.sh new file mode 100755 index 00000000..a2711613 --- /dev/null +++ b/ci.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +golint +go test +go build + +# acceptance test +X=$(./yaml w sample.yaml b.c 3 | ./yaml r - b.c) + +if [ $X != 3 ] + then + echo "Failed acceptance test: expected 2 but was $X" + exit 1 +fi \ No newline at end of file diff --git a/precheckin.sh b/precheckin.sh index 61c04441..b362e878 100755 --- a/precheckin.sh +++ b/precheckin.sh @@ -1,17 +1,7 @@ #!/bin/bash gofmt -w . -golint -go test -go build -# acceptance test -X=$(./yaml w sample.yaml b.c 3 | ./yaml r - b.c) - -if [ $X != 3 ] - then - echo "Failed acceptance test: expected 2 but was $X" - exit 1 -fi +./ci.sh go install