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