-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
74 lines (64 loc) · 2.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Travis configuration for go
#
# See README for more information about this repository.
#
# This repository does NOT do any deployments or installs. However,
# it includes a lot of integration tests, which often require
# credentials.
#
# * decrypt service account credentials
# * install the Google Cloud SDK command line tools (gcloud)
# * cache the gcloud installation and setup
# * test and build the go code
#
language: go
go:
- 1.20
dist: jammy # 22.04
before_install:
# Coverage tools
- go install github.com/mattn/goveralls@latest
- go install github.com/wadey/gocovmerge@latest
# Install gcloud, for integration tests.
- $TRAVIS_BUILD_DIR/travis/install_gcloud.sh
- source "${HOME}/google-cloud-sdk/path.bash.inc"
# Install test credentials.
# Note that anyone with github ACLs to push to a branch can hack .travis.yml
# and discover these credentials in the travis logs.
- echo $TEST_SERVICE_ACCOUNT_mlab_testing | base64 -d > travis-testing.json
- gcloud auth activate-service-account --key-file=travis-testing.json
- echo Branch is ${TRAVIS_BRANCH} and Tag is $TRAVIS_TAG
- echo EVENT_TYPE is ${TRAVIS_EVENT_TYPE}
- if [[ ${TRAVIS_EVENT_TYPE} == cron ]]; then TEST_TAGS=integration; fi;
- echo TEST_TAGS is ${TEST_TAGS}
# These directories will be cached on successful "script" builds, and restored,
# if available, to save time on future builds.
cache:
directories:
- "$HOME/google-cloud-sdk/"
script:
- export GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/travis-testing.json
# Run every regular unit test.
- go test -covermode=count -coverprofile=_coverage.cov -v ./...
# bqx should also have its integration tests run.
- go test -covermode=count -coverprofile=_bqext.cov -v ./cloud/bqx -tags=$TEST_TAGS
# Check we haven't broken any dependent projects
# Many things are currently broken, so temporarily removing the vets.
# - go get -t github.com/m-lab/etl/...
# - go vet github.com/m-lab/etl/...
# - go get -t github.com/m-lab/etl-gardener/...
# - go vet github.com/m-lab/etl-gardener/...
- go get -t github.com/m-lab/uuid/...
- go vet github.com/m-lab/uuid/...
# - go get -t github.com/m-lab/pusher/...
# - go vet github.com/m-lab/pusher/...
# We should also check these, but they currently fail due to C issues.
# - go get -t github.com/m-lab/ndt-server/...
# - go vet github.com/m-lab/ndt-server/...
# - go get -t github.com/m-lab/annotation-service/...
# - go vet github.com/m-lab/annotation-service/...
# Run coveralls "after script" so failures here do not cause the build to fail.
after_script:
# Coveralls
- $HOME/gopath/bin/gocovmerge *.cov > __merged.cov
- $HOME/gopath/bin/goveralls -coverprofile=__merged.cov -service=travis-pro