aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--Makefile23
2 files changed, 16 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index 2a186aa..f530e1e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,8 +17,7 @@ addons:
- git # Needed to stop git from getting deleted
install:
- - make go-tools
- - make test-setup
+ - make travis-install
script:
- - make check
+ - make travis-script
diff --git a/Makefile b/Makefile
index e2f0bd9..24f37ee 100644
--- a/Makefile
+++ b/Makefile
@@ -110,11 +110,18 @@ update:
@govendor remove +unused
# Format all the Go and C code
-.PHONY: format
+.PHONY: format format-check
format:
@gofmt -l -s -w $(GO_FILES)
@clang-format -i -style=Google $(C_FILES)
+format-check:
+ @gofmt -s -d $(GO_FILES) \
+ | ./input_fail.py "Incorrectly formatted Go files. Run \"make format\"."
+ @clang-format -i -style=Google -output-replacements-xml $(C_FILES) \
+ | grep "<replacement " \
+ | ./input_fail.py "Incorrectly formatted C files. Run \"make format\"."
+
# Run lint rules (skipping generated files)
.PHONY: lint
lint:
@@ -155,14 +162,12 @@ test-teardown:
sudo rmdir $(MOUNT)
rm -f $(IMAGE)
-##### Commands for Travis CI #####
+##### Travis CI Commands
+.PHONY: travis-setup travis-script
+travis-install: go-tools test-setup
+ go get -u github.com/mattn/goveralls
-.PHONY: check
-check: lint default test
+travis-script: lint format-check default
+ goveralls -service=travis-ci
@govendor list +missing +external +unused \
| ./input_fail.py "Incorrect vendored dependencies. Run \"make update\"."
- @gofmt -s -d $(GO_FILES) \
- | ./input_fail.py "Incorrectly formatted Go files. Run \"make format\"."
- @clang-format -i -style=Google -output-replacements-xml $(C_FILES) \
- | grep "<replacement " \
- | ./input_fail.py "Incorrectly formatted C files. Run \"make format\"."