Skip to content

Commit e580c7f

Browse files
rayanimeshtz70s
authored andcommitted
travis: Add compile check for all supported platforms (go-sql-driver#1070)
Implements a Travis CI task that checks if the driver compiles on all platforms supported by Go. Fixes go-sql-driver#1050
1 parent b796c7a commit e580c7f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,6 @@ script:
125125
- go test -v -covermode=count -coverprofile=coverage.out
126126
- go vet ./...
127127
- .travis/gofmt.sh
128+
- .travis/complie_check.sh
128129
after_script:
129130
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci

.travis/complie_check.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
dist_list=$(go tool dist list)
4+
5+
for dist in ${dist_list}; do
6+
GOOS=$(echo ${dist} | cut -d "/" -f 1)
7+
GOARCH=$(echo ${dist} | cut -d "/" -f 2)
8+
set +e
9+
GOOS=${GOOS} GOARCH=${GOARCH} go tool compile -V > /dev/null 2>&1
10+
if [[ $? -ne 0 ]]; then
11+
echo "Compile support for ${GOOS}/${GOARCH} is not provided; skipping"
12+
continue
13+
fi
14+
set -e
15+
echo "Building ${GOOS}/${GOARCH}"
16+
GOOS=${GOOS} GOARCH=${GOARCH} go build -o /dev/null
17+
done

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Achille Roussel <achille.roussel at gmail.com>
1616
Alex Snast <alexsn at fb.com>
1717
Alexey Palazhchenko <alexey.palazhchenko at gmail.com>
1818
Andrew Reid <andrew.reid at tixtrack.com>
19+
Animesh Ray <mail.rayanimesh at gmail.com>
1920
Arne Hormann <arnehormann at gmail.com>
2021
Ariel Mashraki <ariel at mashraki.co.il>
2122
Asta Xie <xiemengjun at gmail.com>

0 commit comments

Comments
 (0)