Skip to content

Commit 0c5ebb1

Browse files
eighthaveDavid Fifield
authored andcommitted
add .gitlab-ci.yml file
1 parent ed20e74 commit 0c5ebb1

File tree

1 file changed

+164
-0
lines changed

1 file changed

+164
-0
lines changed

.gitlab-ci.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
2+
# use the packages for Go
3+
.ubuntu-template: &ubuntu-template
4+
variables:
5+
DEBIAN_FRONTEND: noninteractive
6+
GOPATH: /usr/share/gocode
7+
before_script:
8+
- apt-get -qy update
9+
- apt-get -qy install --no-install-recommends
10+
build-essential
11+
git
12+
golang-github-smartystreets-goconvey-dev
13+
golang-race-detector-runtime
14+
libx11-dev
15+
locales
16+
pkg-config
17+
- mkdir -p $GOPATH
18+
19+
# use Go installed as part of the official, Debian-based Docker images
20+
.golang-docker-debian-template: &golang-docker-debian-template
21+
variables:
22+
DEBIAN_FRONTEND: noninteractive
23+
before_script:
24+
- apt-get -qy update
25+
- apt-get -qy install --no-install-recommends
26+
ca-certificates
27+
git
28+
lbzip2
29+
libx11-dev
30+
locales
31+
pkg-config
32+
wget
33+
xz-utils
34+
- go get github.com/smartystreets/goconvey/convey
35+
36+
.build_env_setup: &build_env_setup |
37+
set -x
38+
cat /etc/apt/sources.list | sed 's,^deb,deb-src,' >> /etc/apt/sources.list
39+
apt-get -qy update
40+
apt-get -qy install --no-install-recommends git locales
41+
apt-get -qy build-dep chromium-browser
42+
# libwebrtc build wants en_US.UTF-8
43+
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen || echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
44+
locale-gen
45+
# Create symbolic links under $GOPATH, this is needed for local build
46+
export src=$GOPATH/src
47+
mkdir -p $src/github.com/keroserene
48+
mkdir -p $src/gitlab.com/$CI_PROJECT_NAMESPACE
49+
ln -s $CI_PROJECT_DIR $src/github.com/keroserene/go-webrtc
50+
ln -s $CI_PROJECT_DIR $src/gitlab.com/$CI_PROJECT_PATH
51+
# build libwebrtc binaries
52+
git config --global user.name "John Doe"
53+
git config --global user.email "jdoe@email.com"
54+
git config --global core.autocrlf false
55+
git config --global core.filemode false
56+
rm -rf include/ lib/
57+
set +x
58+
59+
.artifacts-template: &artifacts-template
60+
artifacts:
61+
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
62+
paths:
63+
- include/
64+
- lib/
65+
when:
66+
always
67+
expire_in: 1 day
68+
after_script:
69+
- echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs"
70+
71+
.script-template: &script-template
72+
except:
73+
- schedules
74+
script:
75+
# Create symbolic links under $GOPATH, this is needed for local build
76+
- export src=$GOPATH/src
77+
- mkdir -p $src/github.com/keroserene
78+
- mkdir -p $src/gitlab.com/$CI_PROJECT_NAMESPACE
79+
- ln -s $CI_PROJECT_DIR $src/github.com/keroserene/go-webrtc
80+
- ln -s $CI_PROJECT_DIR $src/gitlab.com/$CI_PROJECT_PATH
81+
82+
# build it for go
83+
- cd $src/github.com/keroserene/go-webrtc
84+
- go get -v .
85+
- go build -v -x .
86+
- go vet -v .
87+
- go test -v -race .
88+
89+
90+
# -- jobs ------------------------------------------------------------
91+
92+
debian-stretch_go-1.10:
93+
image: golang:1.10-stretch
94+
<<: *golang-docker-debian-template
95+
<<: *artifacts-template
96+
<<: *script-template
97+
98+
debian-stretch_go-1.11:
99+
image: golang:1.11-stretch
100+
<<: *golang-docker-debian-template
101+
<<: *artifacts-template
102+
<<: *script-template
103+
104+
ubuntu-devel:
105+
image: ubuntu:devel
106+
<<: *ubuntu-template
107+
<<: *artifacts-template
108+
<<: *script-template
109+
110+
ubuntu-rolling:
111+
image: ubuntu:rolling
112+
<<: *ubuntu-template
113+
<<: *artifacts-template
114+
<<: *script-template
115+
116+
ubuntu-lts:
117+
image: ubuntu:latest
118+
<<: *ubuntu-template
119+
<<: *artifacts-template
120+
<<: *script-template
121+
122+
libwebrtc-linux-amd64-magic:
123+
only:
124+
- schedules
125+
image: debian:stretch
126+
# this job needs 20+ gigs of disk
127+
tags:
128+
- largedisk
129+
<<: *artifacts-template
130+
script:
131+
- *build_env_setup
132+
- GOOS=linux GOARCH=amd64 ./build.sh
133+
134+
libwebrtc-linux-arm-magic:
135+
only:
136+
- schedules
137+
image: debian:stretch
138+
# this job needs 20+ gigs of disk
139+
tags:
140+
- largedisk
141+
<<: *artifacts-template
142+
script:
143+
- *build_env_setup
144+
- apt-get -qy install --no-install-recommends binutils-arm-linux-gnueabihf
145+
- GOOS=linux GOARCH=arm ./build.sh
146+
147+
android:
148+
image: golang:1.11-stretch
149+
# this job needs 20+ gigs of disk
150+
tags:
151+
- largedisk
152+
only:
153+
- schedules
154+
<<: *golang-docker-debian-template
155+
<<: *artifacts-template
156+
script:
157+
- *build_env_setup
158+
- apt-get -qy install --no-install-recommends lsb-release sudo
159+
- export WEBRTC_SRC="$CI_PROJECT_DIR/third_party/webrtc/src"
160+
- export ANDROID_HOME=$WEBRTC_SRC/third_party/android_tools/sdk
161+
- GOOS=android GOARCH=arm ./build.sh || ( $WEBRTC_SRC/build/install-build-deps-android.sh && GOOS=android GOARCH=arm ./build.sh )
162+
after_script:
163+
- cat third_party/webrtc/.gclient || true
164+
- cat third_party/webrtc/.gclient_entries || true

0 commit comments

Comments
 (0)