-
Notifications
You must be signed in to change notification settings - Fork 17
/
.gitlab-ci.yml
121 lines (110 loc) · 3.71 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
---
# set up apt for automated use
.apt-template: &apt-template
- export LC_ALL=C.UTF-8
- export DEBIAN_FRONTEND=noninteractive
- echo Etc/UTC > /etc/timezone
- echo 'quiet "1";'
'APT::Get::Assume-Yes "true";'
'APT::Install-Recommends "0";'
'APT::Install-Suggests "0";'
'Acquire::Retries "20";'
'Dpkg::Use-Pty "0";'
> /etc/apt/apt.conf.d/99gitlab
- apt-get update
- apt-get dist-upgrade
.test-template: &test-template
artifacts:
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
paths:
- client/client
expire_in: 1 day
when: always
after_script:
- echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs"
# -- jobs ------------------------------------------------------------
envoy:
image: debian:bullseye-backports
artifacts:
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_JOB_ID}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
paths:
- android/envoy/build/outputs/aar/*.*
expire_in: 1 week
when: on_success
script:
- *apt-template
- apt-get install default-jdk-headless git sdkmanager
- export ANDROID_SDK_ROOT=/opt/android-sdk
- sdkmanager tools platform-tools "build-tools;30.0.2" "platforms;android-29"
- cd android
- ./gradlew assembleRelease
android:
image: ubuntu:20.04
cache:
paths:
- .gradle/wrapper
- .gradle/caches
only:
changes:
- native/
artifacts:
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_JOB_ID}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
paths:
- "*/*.aar"
- "*/*.jar"
expire_in: 1 week
when: on_success
variables:
ANDROID_SDK_ROOT: /opt/android-sdk
LANG: C.UTF-8
before_script: # things that need root go here, to support the Vagrant setup
- *apt-template
- apt-get install
build-essential
curl
git
gnupg
lbzip2
libx11-dev
ninja-build
openjdk-8-jdk-headless
pkg-config
python
python3
python3-requests
unzip
wget
script:
# build cronet binaries
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- export DEPOT_TOOLS_ROOT=`pwd`/depot_tools
- export PATH=$PATH:$DEPOT_TOOLS_ROOT
- 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
- git clone --depth=1 --branch=0.4 https://gitlab.com/fdroid/sdkmanager.git
- git -C sdkmanager checkout -B master b5a5640fc4cdc151696b2d27a5886119ebd3a8b7
- export sdkmanager=`pwd`/sdkmanager/sdkmanager.py
- $sdkmanager tools
- ndkVersion=$(sed -En 's,^ *ndkVersion *\W([0-9.]+)\W.*,\1,p' android/envoy/build.gradle)
- $sdkmanager "ndk;$ndkVersion" "platforms;android-29"
- mkdir -p chromium
- cd chromium
- export CHROMIUM_SRC_ROOT=`pwd`/src
- fetch --no-history android
- cd src
- build/install-build-deps-android.sh
- $CI_PROJECT_DIR/native/checkout-to-tag.sh
# set up dev env in case manual work is needed
- echo >> /etc/profile.d/env.sh
- echo "export DEPOT_TOOLS_ROOT=$DEPOT_TOOLS_ROOT" >> /etc/profile.d/env.sh
- echo "export CHROMIUM_SRC_ROOT=$CHROMIUM_SRC_ROOT" >> /etc/profile.d/env.sh
- echo 'export PATH=$PATH:$DEPOT_TOOLS_ROOT' >> /etc/profile.d/env.sh
- cd $CI_PROJECT_DIR
- sed -i 's,/bin/bash$,/bin/bash -x,' a*/*.sh # show commands as they run
- ./native/build_cronet.sh release
- ./native/build_cronet.sh debug # build-envoy.sh wants both release and debug
- mkdir -p android/cronet
- cp native/cronet-debug.aar android/cronet/
- ./android/build-envoy.sh