Skip to content

Commit 92acb5a

Browse files
authored
Merge pull request #20 from jattento/feature/check-no-changes-after-make
check make repo changes
2 parents 2a18bb2 + 30f416a commit 92acb5a

File tree

5 files changed

+54
-9
lines changed

5 files changed

+54
-9
lines changed

.ci/gofmt.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
BASEDIR=$(dirname "$0")
4+
5+
go_fmt() {
6+
format=$(go fmt ./...)
7+
if [[ ${format} ]]; then
8+
echo "go fmt failed:"
9+
echo "${format}"
10+
exit 1
11+
else
12+
echo "go fmt passed in"
13+
fi
14+
}
15+
16+
main() {
17+
cd ${BASEDIR}/..
18+
19+
go_fmt
20+
}
21+
22+
main "$@"

.ci/make.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
git_status_output=`git status`
4+
5+
make -f Makefile || exit
6+
7+
git_status_output_after=`git status`
8+
9+
if [[ "$git_status_output" != "$git_status_output_after" ]]; then
10+
echo ERROR: make command modified code
11+
echo "$git_status_output"
12+
echo "$git_status_output_after"
13+
exit 1
14+
fi
15+

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
language: go
22

33
go:
4+
- 1.15.x
45
- 1.14.x
6+
- 1.13.x
7+
8+
install: true
9+
10+
services:
11+
- docker
512

613
before_install:
714
- go get -t -v ./...
815
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
916

1017
script:
1118
- go test ./... -race -coverprofile=coverage.txt -covermode=atomic
12-
- make
19+
- bash .ci/make.sh
20+
- bash .ci/gofmt.sh
1321

1422
after_success:
1523
- bash <(curl -s https://codecov.io/bash)

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Required tools
2-
GOTOOLS_CHECK = golangci-lint
2+
GOTOOLS_CHECK = go golangci-lint
33

4-
all: fmt ensure-deps linter test
4+
all: ensure-deps linter test
55

66
### Testing
77
test:
@@ -14,10 +14,6 @@ test-cover:
1414
test-integration:
1515
go test -tags integration ./... -covermode=atomic -coverpkg=./... -count=1 -race
1616

17-
### Formatting, linting, and deps
18-
fmt:
19-
go fmt ./...
20-
2117
ensure-deps:
2218
@echo "==> Running go mod tidy"
2319
go mod download
@@ -30,4 +26,4 @@ linter:
3026
# To avoid unintended conflicts with file names, always add to .PHONY
3127
# unless there is a reason not to.
3228
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
33-
.PHONY: check_tools test test-cover fmt linter ensure-deps
29+
.PHONY: all check_tools test test-cover linter ensure-deps

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[![codecov](https://codecov.io/gh/jattento/go-iso8583/branch/master/graph/badge.svg)](https://codecov.io/gh/jattento/go-iso8583)
2-
[![Build Status](https://travis-ci.com/jattento/go-iso8583.svg?branch=master)](https://travis-ci.com/jattento/go-iso8583)
32

3+
| Version | Build |
4+
|----------|:-------------:|
5+
| Go 1.15 |[![Build Status](https://travis-ci.com/jattento/go-iso8583.svg?branch=master)](https://travis-ci.com/jattento/go-iso8583)|
6+
| Go 1.14 |[![Build Status](https://travis-ci.com/jattento/go-iso8583.svg?branch=master)](https://travis-ci.com/jattento/go-iso8583)|
7+
| Go 1.13 |[![Build Status](https://travis-ci.com/jattento/go-iso8583.svg?branch=master)](https://travis-ci.com/jattento/go-iso8583)|
48
# go-iso8583
59

610
An easy to use, yet flexible marshaler for ISO-8583.

0 commit comments

Comments
 (0)