This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path.travis.yml
84 lines (79 loc) · 2.29 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
75
76
77
78
79
80
81
82
83
84
language: go
go: 1.14.x
os: linux
dist: bionic
# Don't indent any line more than one level to avoid '\n' characters in the converter string,
# which breaks the regex free-spacing modifier. Also, do NOT include comments in the regex string.
# The logic:
# * Build on push to branches on forks that setup Travis - not tied to the
# kubernetes-sigs/minibroker Travis account.
# * Build on branch master that is not tagged.
# * Build on kubernetes-sigs/minibroker when a tag is present and the branch matches a semver
# string.
if: >-
(repo != "kubernetes-sigs/minibroker")
OR ((branch = master) AND (tag IS NOT present))
OR (
(repo = "kubernetes-sigs/minibroker")
AND (tag IS present)
AND (branch ~= /^(?x)
v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)
(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?
(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?
$/)
)
cache:
directories:
- ${HOME}/assets
- ${GOPATH}/pkg/mod
- ${GOPATH}/bin
jobs:
include:
- name: Verify
stage: verify
script: make verify
- name: Lint
stage: lint
before_script:
- GO111MODULE=on go install github.com/golang/mock/mockgen
script: make lint
- name: Test
stage: test
before_script:
- go install github.com/onsi/ginkgo/ginkgo
script: make test-unit
- name: Integration tests
stage: test-integration
services:
- docker
env:
- CHANGE_MINIKUBE_NONE_USER=false
- MINIKUBE_HOME=${HOME}
- TEST_PROVISION_TIMEOUT=5m
- TEST_BIND_TIMEOUT=5m
- TEST_ASSERT_TIMEOUT=2m
# Forces the version.sh script to fetch tags and unshallow the git repository.
- VERSION_FORCE_TAG_FETCH=true
before_install:
- sudo apt-get -qq -y install conntrack
before_script:
- ci/install/integration.sh
- go install github.com/onsi/ginkgo/ginkgo
script: ci/test_integration.sh
- name: Release
stage: release
services:
- docker
env:
# Forces the version.sh script to fetch tags and unshallow the git repository.
- VERSION_FORCE_TAG_FETCH=true
before_script:
- ci/install/release.sh
script: ci/release.sh
stages:
- verify
- lint
- test
- test-integration
- name: release
if: (repo = "kubernetes-sigs/minibroker") AND (tag IS present) AND (branch != master)