use go module for dependencies (#594)

This commit is contained in:
ruben 2019-05-21 22:56:55 +02:00 committed by Brendan Abolivier
parent 4d588f7008
commit 74827428bd
6109 changed files with 216 additions and 1114821 deletions

View file

@ -4,20 +4,16 @@
set -eu
export GOPATH="$(pwd):$(pwd)/vendor"
export PATH="$PATH:$(pwd)/bin"
echo "Checking that it builds"
gb build
# Check that all the packages can build.
# When `go build` is given multiple packages it won't output anything, and just
# checks that everything builds. This seems to do a better job of handling
# missing imports than `gb build` does.
# checks that everything builds.
echo "Double checking it builds..."
go build github.com/matrix-org/dendrite/cmd/...
go build ./cmd/...
./scripts/find-lint.sh
echo "Testing..."
gb test
go test ./...

View file

@ -15,11 +15,10 @@ set -eux
cd `dirname $0`/..
export GOPATH="$(pwd):$(pwd)/vendor"
# prefer the versions of gometalinter and the linters that we install
# to anythign that ends up on the PATH.
export PATH="$(pwd)/bin:$PATH"
# gometalinter doesn't seem to work without this.
# We should move from gometalinter asap as per https://github.com/matrix-org/dendrite/issues/697 so this is a temporary
# fix.
export GO111MODULE=off
args=""
if [ ${1:-""} = "fast" ]
@ -36,7 +35,8 @@ then args="$args --enable-gc"
fi
echo "Installing lint search engine..."
gb build github.com/alecthomas/gometalinter/
go get github.com/alecthomas/gometalinter/
gometalinter --config=linter.json ./... --install
echo "Looking for lint..."

View file

@ -1,4 +1,4 @@
# /bin/bash
#! /bin/bash
# Downloads, installs and runs a kafka instance
@ -8,13 +8,10 @@ cd `dirname $0`/..
mkdir -p .downloads
# The mirror to download kafka from is picked from the list of mirrors at
# https://www.apache.org/dyn/closer.cgi?path=/kafka/2.1.0/kafka_2.11-2.1.0.tgz
# TODO: Check the signature since we are downloading over HTTP.
MIRROR=http://apache.mirror.anlx.net/kafka/2.1.0/kafka_2.11-2.1.0.tgz
KAFKA_URL=http://archive.apache.org/dist/kafka/2.1.0/kafka_2.11-2.1.0.tgz
# Only download the kafka if it isn't already downloaded.
test -f .downloads/kafka.tgz || wget $MIRROR -O .downloads/kafka.tgz
test -f .downloads/kafka.tgz || wget $KAFKA_URL -O .downloads/kafka.tgz
# Unpack the kafka over the top of any existing installation
mkdir -p kafka && tar xzf .downloads/kafka.tgz -C kafka --strip-components 1
# Start the zookeeper running in the background.

View file

@ -12,8 +12,7 @@ set -eu
export GOGC=400
export DENDRITE_LINT_DISABLE_GC=1
export GOPATH="$(pwd):$(pwd)/vendor"
export PATH="$PATH:$(pwd)/bin"
export GO111MODULE=on
# starts a travis fold section. The first argument is the name of the fold
# section (which appears on the RHS) and may contain no spaces. Remaining
@ -51,29 +50,18 @@ if [ "${TEST_SUITE:-lint}" == "lint" ]; then
fi
if [ "${TEST_SUITE:-unit-test}" == "unit-test" ]; then
gb test
go test ./...
fi
if [ "${TEST_SUITE:-integ-test}" == "integ-test" ]; then
travis_start gb-build "Building dendrite and integ tests"
gb build
travis_start go-build "Building dendrite and integ tests"
go install ./cmd/...
travis_end
# Check that all the packages can build.
# When `go build` is given multiple packages it won't output anything, and just
# checks that everything builds. This seems to do a better job of handling
# missing imports than `gb build` does.
go build github.com/matrix-org/dendrite/cmd/...
# Check that the servers build (this is done explicitly because `gb build` can silently fail (exit 0) and then we'd test a stale binary)
gb build github.com/matrix-org/dendrite/cmd/dendrite-room-server
gb build github.com/matrix-org/dendrite/cmd/roomserver-integration-tests
gb build github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server
gb build github.com/matrix-org/dendrite/cmd/syncserver-integration-tests
gb build github.com/matrix-org/dendrite/cmd/create-account
gb build github.com/matrix-org/dendrite/cmd/dendrite-media-api-server
gb build github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests
gb build github.com/matrix-org/dendrite/cmd/client-api-proxy
# checks that everything builds.
go build ./cmd/...
# Create necessary certificates and keys to run dendrite
travis_start certs "Building SSL certs"
@ -92,7 +80,7 @@ if [ "${TEST_SUITE:-integ-test}" == "integ-test" ]; then
# Run the integration tests
for i in roomserver syncserver mediaapi; do
travis_start "$i-integration-tests" "Running integration tests for $i"
bin/$i-integration-tests
$i-integration-tests
travis_end
done
fi