Skip to content

Commit 4a68c9d

Browse files
committed
Merge pull request #107 from vbatts/work_around_travis
travis: use a `make .gitvalidation` target
2 parents 171926b + f55a869 commit 4a68c9d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ before_script:
1212

1313
before_install:
1414
- docker pull vbatts/pandoc
15-
- go get github.com/vbatts/git-validation
15+
- make install.tools
1616
- go get github.com/alecthomas/gometalinter
1717
- gometalinter --install --update
1818
- go get -t -d ./...
1919

2020
install: true
2121

2222
script:
23-
- git-validation -run DCO,short-subject -v -range ${TRAVIS_COMMIT_RANGE}
23+
- make .gitvalidation
2424
- make lint
2525
- make check-license
2626
- make test

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ FIGURE_FILES := \
1515
OUTPUT ?= output/
1616
DOC_FILENAME ?= oci-image-spec
1717

18+
EPOCH_TEST_COMMIT ?= v0.2.0
19+
1820
default: help
1921

2022
help:
@@ -82,6 +84,23 @@ test:
8284
img/%.png: %.dot
8385
dot -Tpng $^ > $@
8486

87+
.PHONY: .gitvalidation
88+
89+
# When this is running in travis, it will only check the travis commit range
90+
.gitvalidation:
91+
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
92+
ifeq ($(TRAVIS),true)
93+
git-validation -q -run DCO,short-subject,dangling-whitespace
94+
else
95+
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
96+
endif
97+
98+
.PHONY: install.tools
99+
install.tools: .install.gitvalidation
100+
101+
.install.gitvalidation:
102+
go get github.com/vbatts/git-validation
103+
85104
clean:
86105
rm -rf *~ $(OUTPUT)
87106
.PHONY: \

0 commit comments

Comments
 (0)