-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.gitlab-ci.yml
215 lines (208 loc) · 10.2 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
stages:
- linux_dedicated
- linux_desktop
- android
- coverity_scan
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: $CI_JOB_NAME
paths:
- ccache
linux_dedicated:
# image: ubuntu:bionic
image: registry.gitlab.com/mr0maks/gitlab_ci_images:bionic_dedicated
stage: linux_dedicated
before_script:
# - dpkg --add-architecture i386
# - apt update
# - apt install -y git cmake ccache p7zip-full gcc-multilib g++-multilib build-essential zlib1g:i386 libstdc++6:i386 libunwind-dev:i386
- mkdir -p ccache
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
script:
- mkdir $CI_JOB_STAGE
- cd $CI_JOB_STAGE
- export CC="gcc -m32"
- export CXX="gcc -m32"
- cmake -DXASH_DOWNLOAD_DEPENDENCIES=yes -DXASH_SDL=OFF -DXASH_DEDICATED=ON -DXASH_STATIC=ON -DXASH_DLL_LOADER=ON -DXASH_VGUI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
- make -j$(nproc --all)
artifacts:
paths:
- $CI_JOB_STAGE/engine/xash3d
linux_desktop:
# image: ubuntu:bionic
image: registry.gitlab.com/mr0maks/gitlab_ci_images:bionic_desktop
stage: linux_desktop
before_script:
# - dpkg --add-architecture i386
# - apt update
# - apt install -y git curl ccache cmake p7zip-full gcc-multilib g++-multilib build-essential libx11-dev:i386 libxext-dev:i386 libgl1-mesa-dev libasound-dev zlib1g:i386 libstdc++6:i386 libunwind-dev:i386
- mkdir -p ccache
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
script:
- curl -s http://libsdl.org/release/SDL2-2.0.22.tar.gz | tar xzf -
- cd $CI_PROJECT_DIR/SDL2-2.0.22/
- export CC="gcc -msse2 -march=i686 -m32 -ggdb -O2"
- ./configure --disable-dependency-tracking --enable-audio --enable-video --enable-events --disable-render --enable-joystick --disable-haptic --disable-power --enable-threads --enable-timers --enable-loadso --enable-video-opengl --enable-x11-shared --enable-video-x11 --enable-video-x11-xrandr --enable-video-x11-scrnsaver --enable-video-x11-xinput --disable-video-x11-xshape --disable-video-x11-xdbe --disable-libudev --disable-dbus --disable-ibus --enable-sdl-dlopen --disable-video-opengles --disable-cpuinfo --disable-assembly --disable-atomic --enable-alsa
- make -j$(nproc --all)
- mkdir -p ../sdl2-linux
- make install DESTDIR=$CI_PROJECT_DIR/sdl2-linux
- cd ../
- mkdir $CI_JOB_STAGE
- cd $CI_JOB_STAGE
- export CC="gcc -m32"
- export CXX="gcc -m32"
- cmake -DCMAKE_PREFIX_PATH=$CI_PROJECT_DIR/sdl2-linux/usr/local -DXASH_DOWNLOAD_DEPENDENCIES=yes -DXASH_STATIC=ON -DXASH_DLL_LOADER=ON -DXASH_VGUI=ON -DMAINUI_USE_STB=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
- make -j$(nproc --all)
- mkdir artifacts
- cp ../scripts/xash3d.sh artifacts
- cp engine/xash3d artifacts
- cp mainui/libxashmenu.so artifacts
- cp vgui_support/libvgui_support.so artifacts
- cp vgui_support/vgui.so artifacts
- cp $CI_PROJECT_DIR/sdl2-linux/usr/local/lib/$(readlink $CI_PROJECT_DIR/sdl2-linux/usr/local/lib/libSDL2-2.0.so.0) artifacts/libSDL2-2.0.so.0
artifacts:
paths:
- $CI_JOB_STAGE/artifacts/
android:
# image: ubuntu:xenial
image: registry.gitlab.com/mr0maks/gitlab_ci_images:xenial_android
stage: android
before_script:
# - dpkg --add-architecture i386
# - apt update
# - apt install -y curl wget cmake ccache p7zip-full gcc-multilib g++-multilib build-essential zlib1g:i386 libstdc++6:i386 openjdk-8-jdk xz-utils git python2.7 python-minimal
- curl -s http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz | tar xzf -
- curl https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.9-bin.tar.xz | tar xJ
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:$PWD/apache-ant-1.10.9/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk
- sleep 3s; echo y | android update sdk -u --filter platform-tools,build-tools-23.0.1,android-23 --force --all > /dev/null
- sed -e 's/1\.5/1\.7/g' -i $PWD/android-sdk-linux/tools/ant/build.xml
- wget https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip >/dev/null 2>/dev/null
- 7z x ./android-ndk-r11c-linux-x86_64.zip > /dev/null
- mv android-ndk-r11c android-ndk
- mkdir -p ccache
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
script:
- mkdir android && cd android
- git clone --depth 1 https://github.com/tyabus/xash3d-android-project
- cd xash3d-android-project
- cp debug.keystore ~/.android/debug.keystore
- git submodule update --init jni/src/NanoGL/nanogl xash-extras
- git clone --depth 1 https://github.com/tyabus/hlsdk-xash3d jni/src/hlsdk-xash3d -b master
- ln -s $CI_PROJECT_DIR jni/src/Xash3D/xash3d
- bash ./gen-version.sh
- python2 scripts/makepak.py xash-extras assets/extras.pak
- ndk-build -j$(nproc --all) APP_CFLAGS="-w" NDK_CCACHE=ccache
- ant debug -Dtest.version=1
- cp bin/xash3d-debug.apk $CI_PROJECT_DIR/xash3d-debug.apk
artifacts:
paths:
- $CI_PROJECT_DIR/xash3d-debug.apk
android_64bit:
# image: ubuntu:xenial
image: registry.gitlab.com/mr0maks/gitlab_ci_images:xenial_android
stage: android
before_script:
# - dpkg --add-architecture i386
# - apt update
# - apt install -y curl wget cmake ccache p7zip-full gcc-multilib g++-multilib build-essential zlib1g:i386 libstdc++6:i386 openjdk-8-jdk xz-utils git python2.7 python-minimal
- curl -s http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz | tar xzf -
- curl https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.9-bin.tar.xz | tar xJ
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:$PWD/apache-ant-1.10.9/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk
- sleep 3s; echo y | android update sdk -u --filter platform-tools,build-tools-23.0.1,android-23 --force --all > /dev/null
- sed -e 's/1\.5/1\.7/g' -i $PWD/android-sdk-linux/tools/ant/build.xml
- wget https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip >/dev/null 2>/dev/null
- 7z x ./android-ndk-r11c-linux-x86_64.zip > /dev/null
- mv android-ndk-r11c android-ndk
- mkdir -p ccache
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
script:
- mkdir android && cd android
- git clone --depth 1 https://github.com/tyabus/xash3d-android-project
- cd xash3d-android-project
- cp debug.keystore ~/.android/debug.keystore
- git submodule update --init jni/src/NanoGL/nanogl xash-extras
- git clone --depth 1 https://github.com/tyabus/hlsdk-xash3d jni/src/hlsdk-xash3d -b master
- ln -s $CI_PROJECT_DIR jni/src/Xash3D/xash3d
- bash ./gen-version.sh
- python2 scripts/makepak.py xash-extras assets/extras.pak
- NDK_TOOLCHAIN_VERSION=clang ndk-build -j$(nproc --all) XASH_64BIT="1" APP_CFLAGS="-w" NDK_CCACHE=ccache
- ant debug -Dtest.version=1
- cp bin/xash3d-debug.apk $CI_PROJECT_DIR/xash3d-debug.apk
artifacts:
paths:
- $CI_PROJECT_DIR/xash3d-debug.apk
coverity_scan:
# image: ubuntu:bionic
image: registry.gitlab.com/mr0maks/gitlab_ci_images:bionic_desktop
stage: coverity_scan
only:
refs:
- master
before_script:
# - dpkg --add-architecture i386
# - apt update
# - apt install -y wget curl git ccache cmake p7zip-full gcc-multilib g++-multilib build-essential libx11-dev:i386 libxext-dev:i386 libgl1-mesa-dev libasound-dev zlib1g:i386 libstdc++6:i386
- mkdir -p ccache
#- curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
- wget -nv -O /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=tyabus%2Fxash3d"
- tar xfz /tmp/cov-analysis-linux64.tgz
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
script:
- curl -s http://libsdl.org/release/SDL2-2.0.14.tar.gz | tar xzf -
- cd $CI_PROJECT_DIR/SDL2-2.0.14/
- export CC="gcc -msse2 -march=i686 -m32 -ggdb -O2"
- ./configure --disable-dependency-tracking --enable-audio --enable-video --enable-events --disable-render --enable-joystick --disable-haptic --disable-power --enable-threads --enable-timers --enable-loadso --enable-video-opengl --enable-x11-shared --enable-video-x11 --enable-video-x11-xrandr --enable-video-x11-scrnsaver --enable-video-x11-xinput --disable-video-x11-xshape --disable-video-x11-xdbe --disable-libudev --disable-dbus --disable-ibus --enable-sdl-dlopen --disable-video-opengles --disable-cpuinfo --disable-assembly --disable-atomic --enable-alsa
- make -j$(nproc --all)
- mkdir -p ../sdl2-linux
- make install DESTDIR=$CI_PROJECT_DIR/sdl2-linux
- cd ../
- export CC="gcc -m32"
- export CXX="gcc -m32"
- cmake -DCMAKE_PREFIX_PATH=$CI_PROJECT_DIR/sdl2-linux/usr/local -DXASH_DOWNLOAD_DEPENDENCIES=yes -DXASH_STATIC=ON -DXASH_DLL_LOADER=ON -DXASH_VGUI=ON -DMAINUI_USE_STB=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
- cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j1
- cov-analysis-linux64-*/bin/cov-import-scm --dir cov-int --scm git --log cov-int/scm_log.txt 2>&1
- tar cfz cov-int.tar.gz cov-int
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL --form [email protected] --form version="`git describe --tags`" --form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID "