-
Notifications
You must be signed in to change notification settings - Fork 76
/
.gitlab-ci.yml
164 lines (148 loc) · 4.5 KB
/
.gitlab-ci.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
# use the packages for Go
.ubuntu-template: &ubuntu-template
variables:
DEBIAN_FRONTEND: noninteractive
GOPATH: /usr/share/gocode
before_script:
- apt-get -qy update
- apt-get -qy install --no-install-recommends
build-essential
git
golang-github-smartystreets-goconvey-dev
golang-race-detector-runtime
libx11-dev
locales
pkg-config
- mkdir -p $GOPATH
# use Go installed as part of the official, Debian-based Docker images
.golang-docker-debian-template: &golang-docker-debian-template
variables:
DEBIAN_FRONTEND: noninteractive
before_script:
- apt-get -qy update
- apt-get -qy install --no-install-recommends
ca-certificates
git
lbzip2
libx11-dev
locales
pkg-config
wget
xz-utils
- go get github.com/smartystreets/goconvey/convey
.build_env_setup: &build_env_setup |
set -x
cat /etc/apt/sources.list | sed 's,^deb,deb-src,' >> /etc/apt/sources.list
apt-get -qy update
apt-get -qy install --no-install-recommends git locales
apt-get -qy build-dep chromium-browser
# libwebrtc build wants en_US.UTF-8
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen || echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
# Create symbolic links under $GOPATH, this is needed for local build
export src=$GOPATH/src
mkdir -p $src/github.com/keroserene
mkdir -p $src/gitlab.com/$CI_PROJECT_NAMESPACE
ln -s $CI_PROJECT_DIR $src/github.com/keroserene/go-webrtc
ln -s $CI_PROJECT_DIR $src/gitlab.com/$CI_PROJECT_PATH
# build libwebrtc binaries
git config --global user.name "John Doe"
git config --global user.email "[email protected]"
git config --global core.autocrlf false
git config --global core.filemode false
rm -rf include/ lib/
set +x
.artifacts-template: &artifacts-template
artifacts:
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
paths:
- include/
- lib/
when:
always
expire_in: 1 day
after_script:
- echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs"
.script-template: &script-template
except:
- schedules
script:
# Create symbolic links under $GOPATH, this is needed for local build
- export src=$GOPATH/src
- mkdir -p $src/github.com/keroserene
- mkdir -p $src/gitlab.com/$CI_PROJECT_NAMESPACE
- ln -s $CI_PROJECT_DIR $src/github.com/keroserene/go-webrtc
- ln -s $CI_PROJECT_DIR $src/gitlab.com/$CI_PROJECT_PATH
# build it for go
- cd $src/github.com/keroserene/go-webrtc
- go get -v .
- go build -v -x .
- go vet -v .
- go test -v -race .
# -- jobs ------------------------------------------------------------
debian-stretch_go-1.10:
image: golang:1.10-stretch
<<: *golang-docker-debian-template
<<: *artifacts-template
<<: *script-template
debian-stretch_go-1.11:
image: golang:1.11-stretch
<<: *golang-docker-debian-template
<<: *artifacts-template
<<: *script-template
ubuntu-devel:
image: ubuntu:devel
<<: *ubuntu-template
<<: *artifacts-template
<<: *script-template
ubuntu-rolling:
image: ubuntu:rolling
<<: *ubuntu-template
<<: *artifacts-template
<<: *script-template
ubuntu-lts:
image: ubuntu:latest
<<: *ubuntu-template
<<: *artifacts-template
<<: *script-template
libwebrtc-linux-amd64-magic:
only:
- schedules
image: debian:stretch
# this job needs 20+ gigs of disk
tags:
- largedisk
<<: *artifacts-template
script:
- *build_env_setup
- GOOS=linux GOARCH=amd64 ./build.sh
libwebrtc-linux-arm-magic:
only:
- schedules
image: debian:stretch
# this job needs 20+ gigs of disk
tags:
- largedisk
<<: *artifacts-template
script:
- *build_env_setup
- apt-get -qy install --no-install-recommends binutils-arm-linux-gnueabihf
- GOOS=linux GOARCH=arm ./build.sh
android:
image: golang:1.11-stretch
# this job needs 20+ gigs of disk
tags:
- largedisk
only:
- schedules
<<: *golang-docker-debian-template
<<: *artifacts-template
script:
- *build_env_setup
- apt-get -qy install --no-install-recommends lsb-release sudo
- export WEBRTC_SRC="$CI_PROJECT_DIR/third_party/webrtc/src"
- export ANDROID_HOME=$WEBRTC_SRC/third_party/android_tools/sdk
- GOOS=android GOARCH=arm ./build.sh || ( $WEBRTC_SRC/build/install-build-deps-android.sh && GOOS=android GOARCH=arm ./build.sh )
after_script:
- cat third_party/webrtc/.gclient || true
- cat third_party/webrtc/.gclient_entries || true