Skip to content

Commit 5aaea23

Browse files
authored
Merge pull request #1324 from Adirio/travis/stage-order
Order travis stages and clean non-needed tests
2 parents cf950d8 + df46138 commit 5aaea23

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

.travis.yml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,73 +5,73 @@ cache:
55
- $HOME/.cache/go-build
66
- $GOPATH/pkg/mod
77

8-
os:
9-
- linux
10-
- osx
8+
os: linux
119

1210
go:
13-
- "1.13"
11+
- "1.13"
1412

15-
# A build matix defines the K8s versions to use for e2e tests. Travis runs these in parrellel
13+
# A build matrix defines the K8s versions to use for e2e tests. Travis runs these in parallel
1614
env:
1715
- KIND_K8S_VERSION="v1.16.2"
1816
- KIND_K8S_VERSION="v1.15.3"
1917
- KIND_K8S_VERSION="v1.14.1"
20-
- GOPROXY=https://proxy.golang.org/
21-
# As OSX isn't running KIND e2e tests exlude it from the matrix
22-
matrix:
23-
exclude:
24-
- os: osx
25-
env: KIND_K8S_VERSION="v1.16.2"
26-
- os: osx
27-
env: KIND_K8S_VERSION="v1.15.3"
28-
- os: osx
29-
env: KIND_K8S_VERSION="v1.14.1"
30-
- os: linux
31-
env: GOPROXY=https://proxy.golang.org/
3218

3319
git:
3420
depth: 3
3521

3622
go_import_path: sigs.k8s.io/kubebuilder
3723

38-
services:
39-
- docker
40-
41-
before_install:
42-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/gopath/bin; fi
43-
44-
before_script:
24+
services: docker
4525

4626
# Install must be set to prevent default `go get` to run.
4727
# The dependencies have already been vendored by `dep` so
4828
# we don't need to fetch them.
49-
install:
50-
-
29+
install: skip
5130

52-
script:
53-
- ./test.sh
54-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then PATH=$PATH:$(pwd) ./test_e2e.sh; fi
31+
before_script: PATH=$PATH:$(pwd)
32+
33+
script: ./test_e2e.sh
5534

5635
jobs:
5736
include:
58-
- stage: Validations
59-
before_script:
60-
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
61-
script:
62-
- ./scripts/verify.sh
63-
# The golden_test.sh check if the the testdata is updated according to the current changes
64-
# To update the testdata use the Makefile targets `make generate-setup` then `make generate-testdata`
65-
- ./golden_test.sh
66-
- stage: Go Coverage
67-
before_script:
68-
# The following module is used to integrate the projct with coveralls.io. It allow us to easily sent the data.
69-
# More info: https://github.com/mattn/goveralls
70-
- go get github.com/mattn/[email protected]
37+
- stage: linting
38+
env:
39+
before_script: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
40+
script: ./scripts/verify.sh
41+
42+
- stage: golden
43+
# The golden_test.sh check if the the testdata is updated according to the current changes
44+
# To update the testdata use the Makefile targets `make generate-setup` then `make generate-testdata`
45+
env:
46+
before_script: skip
47+
script: ./golden_test.sh
48+
49+
- stage: local
50+
env:
51+
before_script: skip
52+
script: ./test.sh
53+
- stage: local
54+
os: osx
55+
env:
56+
before_script: skip
57+
script: ./test.sh
58+
59+
- stage: coverage
60+
# The following module is used to integrate the projct with goveralls.io. It allow us to easily sent the data.
61+
# More info: https://github.com/mattn/goveralls
62+
env:
63+
before_script: go get github.com/mattn/[email protected]
7164
script:
7265
- make test-coverage
7366
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage-all.out -repotoken=$COVERALLS_TOKEN
7467

68+
stages:
69+
- linting
70+
- golden
71+
- local
72+
- test
73+
- coverage
74+
7575
# TBD. Suppressing for now.
7676
notifications:
7777
email: false

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ GO111MODULE=off test_project gopath/src/project 1
163163

164164
# test project v2
165165
GO111MODULE=on test_project project-v2 2
166+
GO111MODULE=on test_project project-v2-multigroup 2
166167

167168
exit $rc
168169

0 commit comments

Comments
 (0)