Skip to content

Commit

Permalink
travis: Add compile check for all supported platforms (#1070)
Browse files Browse the repository at this point in the history
Implements a Travis CI task that checks if the driver compiles on all platforms supported by Go.

Fixes #1050
  • Loading branch information
rayanimesh committed Mar 11, 2020
1 parent dd9d356 commit 681ffa8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ script:
- go test -v -covermode=count -coverprofile=coverage.out
- go vet ./...
- .travis/gofmt.sh
- .travis/complie_check.sh
after_script:
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci
17 changes: 17 additions & 0 deletions .travis/complie_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e
dist_list=$(go tool dist list)

for dist in ${dist_list}; do
GOOS=$(echo ${dist} | cut -d "/" -f 1)
GOARCH=$(echo ${dist} | cut -d "/" -f 2)
set +e
GOOS=${GOOS} GOARCH=${GOARCH} go tool compile -V > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Compile support for ${GOOS}/${GOARCH} is not provided; skipping"
continue
fi
set -e
echo "Building ${GOOS}/${GOARCH}"
GOOS=${GOOS} GOARCH=${GOARCH} go build -o /dev/null
done
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Achille Roussel <achille.roussel at gmail.com>
Alex Snast <alexsn at fb.com>
Alexey Palazhchenko <alexey.palazhchenko at gmail.com>
Andrew Reid <andrew.reid at tixtrack.com>
Animesh Ray <mail.rayanimesh at gmail.com>
Arne Hormann <arnehormann at gmail.com>
Ariel Mashraki <ariel at mashraki.co.il>
Asta Xie <xiemengjun at gmail.com>
Expand Down

0 comments on commit 681ffa8

Please sign in to comment.