-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
176 lines (169 loc) · 8.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
image: ubuntu:xenial
stages:
- linux_dedicated
- linux_desktop
- android
- coverity_scan
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: $CI_JOB_NAME
paths:
- ccache
linux_dedicated:
stage: linux_dedicated
before_script:
- dpkg --add-architecture i386
- apt update
- apt install -y cmake ccache p7zip-full gcc-multilib g++-multilib zlib1g:i386 libstdc++6: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 out2
- cd out2
- 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 -j2
artifacts:
paths:
- out2/engine/xash3d
linux_desktop:
stage: linux_desktop
before_script:
- dpkg --add-architecture i386
- apt update
- apt install -y curl ccache cmake p7zip-full gcc-multilib g++-multilib libx11-dev:i386 libxext-dev:i386 libgl1-mesa-dev libasound-dev zlib1g:i386 libstdc++6: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.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 -j2
- mkdir -p ../sdl2-linux
- make install DESTDIR=$CI_PROJECT_DIR/sdl2-linux
- cd ../
- mkdir out
- cd out
- 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 -j2
- 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:
- out/artifacts/
android:
stage: android
before_script:
- dpkg --add-architecture i386
- apt update
- apt install -y curl wget cmake ccache p7zip-full gcc-multilib g++-multilib zlib1g:i386 libstdc++6:i386 openjdk-8-jdk xz-utils git python2.7 python-minimal
- curl -s http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz | tar xzf -
- curl https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.7-bin.tar.xz | tar xJ
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:$PWD/apache-ant-1.10.7/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk
- sleep 3s; echo y | android update sdk -u --filter platform-tools,build-tools-19.0.0,android-19 --force --all > /dev/null
- sed -e 's/1\.5/1\.6/g' -i $PWD/android-sdk-linux/tools/ant/build.xml
- wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin >/dev/null 2>/dev/null
- 7z x ./android-ndk-r10e-linux-x86_64.bin > /dev/null
- mv android-ndk-r10e 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
- export GIT_REV_XML=res/values/git-rev.xml
- mkdir -p $(dirname $GIT_REV_XML)
- echo '<?xml version="1.0" encoding="utf-8"?>' > $GIT_REV_XML
- echo '<resources>' >> $GIT_REV_XML
- echo -n '<string name="git_revisions">"' >> $GIT_REV_XML
- echo -n '<b>Version information:</b> ' $*_endl| sed -e s/_endl/'\\n'/ >> $GIT_REV_XML
- git submodule --quiet foreach --recursive 'echo -n \<b\>`basename $name`:\</b\>\ `git log --abbrev-commit --pretty=oneline -1` _endl' | sed -e 's/_endl/\\n/g' | sed -e "s/'/\\\'/g" >> $GIT_REV_XML
- echo -n $USER@$(hostname) $(date +%H:%M:%S-%d-%m-%y) >> $GIT_REV_XML
- echo '"</string>' >> $GIT_REV_XML
- echo '</resources>' >> $GIT_REV_XML
- cat $GIT_REV_XML
- python2 scripts/makepak.py xash-extras assets/extras.pak
- ndk-build -j2 APP_CFLAGS="-w" NDK_CCACHE=ccache
- ln -s android/libs libs
- ant debug -Dtest.version=1
artifacts:
paths:
- android/xash3d-android-project/bin/xash3d-debug.apk
coverity_scan:
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 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 -j2
- 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 "