-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
47 lines (37 loc) · 1.38 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
# Travis configuration for gardener unit tests.
dist: jammy # 22.04
language: go
services:
- docker
go:
- 1.20
###########################################################################
before_install:
- echo Branch is ${TRAVIS_BRANCH} and Tag is ${TRAVIS_TAG}
- sudo apt update && sudo apt install ca-certificates libgnutls30 -y
# 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:
# Install dependencies for all tests.
- cd $TRAVIS_BUILD_DIR
- go get -v -t ./...
- go get -v -tags=integration -t ./...
# Install and run datastore emulator.
- gcloud components install beta
- gcloud components install cloud-datastore-emulator
script:
# Run all the non-integration unit tests.
- cd $TRAVIS_BUILD_DIR
- go test -v -coverprofile=_unit.cov ./...
# Run all integration unit tests. Some tests are repeated, but this preserves
# coverage statistics.
- ./integration-testing.sh
# Also run some concurrency sensitive tests with -race
- go test -v ./tracker/... ./ops/... -race
# Combine coverage of all unit tests and send the results to coveralls.
- $HOME/gopath/bin/gocovmerge _*.cov > _merge.cov
- $HOME/gopath/bin/goveralls -coverprofile=_merge.cov -service=travis-pro || true # Ignore failure