forked from ionorg/ion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
169 lines (157 loc) · 5.06 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
dist: bionic
language: go
env:
global:
- GO111MODULE=on
- GOLANGCI_LINT_VERSION=1.19.1
cache:
directories:
- ${HOME}/.cache/go-build
- ${GOPATH}/pkg/mod
npm: true
yarn: true
_lint_job: &lint_job
env: CACHE_NAME=lint
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
install: skip
before_script:
- |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| bash -s - -b $GOPATH/bin v${GOLANGCI_LINT_VERSION}
script:
- bash .github/lint-filename.sh
- golangci-lint run ./...
_build_job: &build_job
env: CACHE_NAME=build
script:
- go build ./cmd/biz
- go build ./cmd/islb
- go build ./cmd/sfu
_build_avp_docker_job: &build_avp_docker_job
env: CACHE_NAME=build_avp_docker
script:
- echo "TRAVIS_TAG= $TRAVIS_TAG"
- docker build --tag pionwebrtc/ion-avp:latest -f ./docker/avp.Dockerfile .
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag pionwebrtc/ion-avp:latest pionwebrtc/ion-avp:"$TRAVIS_TAG"
deploy:
provider: script
script: docker push pionwebrtc/ion-avp:latest && docker push pionwebrtc/ion-avp:"$TRAVIS_TAG"
on:
tags: true
_build_biz_docker_job: &build_biz_docker_job
env: CACHE_NAME=build_biz_docker
script:
- docker build --tag pionwebrtc/ion-biz:latest -f ./docker/biz.Dockerfile .
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag pionwebrtc/ion-biz:latest pionwebrtc/ion-biz:"$TRAVIS_TAG"
deploy:
provider: script
script: docker push pionwebrtc/ion-biz:latest && docker push pionwebrtc/ion-biz:"$TRAVIS_TAG"
on:
tags: true
_build_islb_docker_job: &build_islb_docker_job
env: CACHE_NAME=build_islb_docker
script:
- docker build --tag pionwebrtc/ion-islb:latest -f ./docker/islb.Dockerfile .
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag pionwebrtc/ion-islb:latest pionwebrtc/ion-islb:"$TRAVIS_TAG"
deploy:
provider: script
script: docker push pionwebrtc/ion-islb:latest && docker push pionwebrtc/ion-islb:"$TRAVIS_TAG"
on:
tags: true
_build_sfu_docker_job: &build_sfu_docker_job
env: CACHE_NAME=build_sfu_docker
script:
- docker build --tag pionwebrtc/ion-sfu:latest -f ./docker/sfu.Dockerfile .
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag pionwebrtc/ion-sfu:latest pionwebrtc/ion-sfu:"$TRAVIS_TAG"
deploy:
provider: script
script: docker push pionwebrtc/ion-sfu:latest && docker push pionwebrtc/ion-sfu:"$TRAVIS_TAG"
on:
tags: true
_test_job: &test_job
env: CACHE_NAME=test
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
install:
- make nodes
script:
- make test
- if [ -n "${TEST_HOOK}" ]; then ${TEST_HOOK}; fi
after_success:
- travis_retry bash <(curl -s https://codecov.io/bash) -c -F go
_test_i386_job: &test_i386_job
env: CACHE_NAME=test386
services: docker
before_install:
- if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
before_script:
- make start_test_services
script:
- testpkgs=${TEST_PACKAGES:-$(go list ./... | grep -v cmd | grep -v conf)}
- |
docker run \
-u $(id -u):$(id -g) \
-e "GO111MODULE=on" \
-e "CGO_ENABLED=0" \
-v ${PWD}:/go/src/github.com/pion/$(basename ${PWD}) \
-v ${HOME}/gopath/pkg/mod:/go/pkg/mod \
-v ${HOME}/.cache/go-build:/.cache/go-build \
-w /go/src/github.com/pion/$(basename ${PWD}) \
--network ion_default \
-it i386/golang:${GO_VERSION}-alpine \
/usr/local/go/bin/go test \
${TEST_EXTRA_ARGS:-} \
-v ${testpkgs}
jobs:
include:
- <<: *lint_job
name: Lint 1.14
go: 1.14
if: branch = master OR tag IS present
- <<: *build_job
name: Build 1.13
go: 1.13
if: branch = master OR tag IS present
- <<: *build_job
name: Build 1.14
go: 1.14
if: branch = master OR tag IS present
- <<: *test_job
name: Test 1.13
go: 1.13
if: branch = master OR tag IS present
- <<: *test_job
name: Test 1.14
go: 1.14
if: branch = master OR tag IS present
- <<: *build_avp_docker_job
name: Build avp docker
if: branch = master OR tag IS present
- <<: *build_biz_docker_job
name: Build biz docker
if: branch = master OR tag IS present
- <<: *build_islb_docker_job
name: Build islb docker
if: branch = master OR tag IS present
- <<: *build_sfu_docker_job
name: Build sfu docker
if: branch = master OR tag IS present
# - <<: *test_i386_job
# name: Test i386 1.13
# env: GO_VERSION=1.13
# go: 1.14 # version for host environment used to go list
# - <<: *test_i386_job
# name: Test i386 1.14
# env: GO_VERSION=1.14
# go: 1.14 # version for host environment used to go list
notifications:
email: false