test-client-godot/.gitlab-ci.yml

210 lines
12 KiB
YAML

# Configuration for Continous Integration
#
# Copyright (C) 2019 AleaJactaEst
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Example to execute locally:
# gitlab-runner exec docker --kubernetes-memory-limit="10g" --kubernetes-service-memory-limit="10g" --kubernetes-memory-request="10g" --kubernetes-helper-memory-limit="10g" 'Build Client Linux 64'
# gitlab-runner exec docker --timeout=3600 'Build Client Linux 64'
# gitlab-runner exec docker --timeout=3600 --kubernetes-memory-limit="10g" --kubernetes-service-memory-limit="10g" --kubernetes-memory-request="10g" --kubernetes-helper-memory-limit="10g" --docker-volumes $PWD/builds:/builds 'Build Client Linux 64'
stages:
- build
variables:
GODOT_VERSION: '3.1.2'
XDG_CACHE_HOME: '/tmp/cache'
XDG_DATA_HOME: '/tmp/data'
XDG_CONFIG_HOME: '/tmp/config'
DOCKER_GODOT_SOURCE: '/root/workspace/godot/'
Build Client Linux 64 (Ter):
# ERROR: _load: No loader found for resource: res://assets/GUI/images/Login-Khanat-background.png
stage: build
tags:
- Docker
image: ubuntu:xenial
script:
- export -p WORKDIR=$PWD
- apt-get update
- apt-get dist-upgrade -y
- DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y scons git g++ wget unzip ca-certificates python python-openssl
- git submodule update --init --recursive
- mkdir -p $DOCKER_GODOT_SOURCE $XDG_CACHE_HOME $XDG_DATA_HOME $XDG_CONFIG_HOME $XDG_DATA_HOME/godot/app_userdata/Khanat/logs
- wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_linux_server.64.zip
- wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
- mkdir -p ~/.cache ~/.config/godot ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- unzip Godot_v${GODOT_VERSION}-stable_linux_server.64.zip
- mv Godot_v${GODOT_VERSION}-stable_linux_server.64 /usr/local/bin/godot
- unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz
- mv templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- rm -f Godot_v${GODOT_VERSION}-stable_export_templates.tpz Godot_v${GODOT_VERSION}-stable_linux_server.64.zip
# - godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
- scons -j$(nproc) -C godot-cpp platform=linux target=release generate_bindings=yes custom_api_file=godot_headers/api.json bits=64
- scons -j$(nproc) -C gdnative platform=linux target=release bits=64
- /usr/local/bin/godot --editor --quit
- /usr/local/bin/godot --quit -v --path $WORKDIR --export khaganat.linux.64 khaganat.linux64.bin
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
- ls -la || echo ""
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-client-linux-64"
paths:
- khaganat.linux64.*
when: manual
Build Client Linux 64 (Bis):
# ERROR: _load: No loader found for resource: res://assets/GUI/images/Login-Khanat-background.png
stage: build
tags:
- Docker
image: amd64/debian:10
script:
- export -p WORKDIR=$PWD
- apt-get update
- apt-get dist-upgrade -y
- DEBIAN_FRONTEND=noninteractive apt-get install -y scons git g++ wget unzip
#- DEBIAN_FRONTEND=noninteractive apt-get install -y libxcursor1 libxinerama1 libxrandr2 libxi6 libasound2 libpulse0 libgl1
#- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev libxrandr-dev yasm
- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev libxi-dev libxrandr-dev mingw-w64 git unzip upx vim wget ca-certificates
- git submodule update --init --recursive
- mkdir -p $DOCKER_GODOT_SOURCE $XDG_CACHE_HOME $XDG_DATA_HOME $XDG_CONFIG_HOME
- git clone -b $GODOT_VERSION --single-branch https://github.com/godotengine/godot.git $DOCKER_GODOT_SOURCE
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
- mkdir -p ~/.cache ~/.config/godot ~/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.godot/templates
- unzip /tmp/Godot_v${GODOT_VERSION}-stable_export_templates.tpz -d /tmp
- mv /tmp/templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- ln -s ~/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.godot/templates
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${DOCKER_GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_x11.64.zip
# - godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
- scons -j$(nproc) -C godot-cpp platform=linux target=release generate_bindings=yes custom_api_file=godot_headers/api.json bits=64
- scons -j$(nproc) -C gdnative platform=linux target=release bits=64
- ls -la gdnative/bin
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_x11.64.zip
- unzip /tmp/Godot_v${GODOT_VERSION}-stable_x11.64.zip -d /tmp
- mv /tmp/Godot_v${GODOT_VERSION}-stable_x11.64 /usr/local/bin/godot
# Start Audio server
- pulseaudio -D
# Start X11 server (and launch build)
- pwd
- echo "WORKDIR:$WORKDIR"
- mkdir -p .import /tmp/data/godot/app_userdata/Khanat/logs
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
- ls $WORKDIR/assets/GUI/images/Login-Khanat-background.png
- xvfb-run -a -n 99 --server-args="-ac -screen 0 1024x768x24 +extension GLX" /usr/local/bin/godot --editor --quit
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
- xvfb-run -a -n 99 --server-args="-ac -screen 0 1024x768x24 +extension GLX" /usr/local/bin/godot --quit -v --path $WORKDIR --export khaganat.linux.64 khaganat.linux64.bin
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
- ls -la || echo ""
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-client-linux-64"
paths:
- khaganat.linux64.*
when: manual
Build Client Linux 64:
# ERROR: _load: No loader found for resource: res://assets/GUI/images/Login-Khanat-background.png
stage: build
tags:
- Docker
image: amd64/debian:10
script:
- export -p WORKDIR=$PWD
- apt-get update
- apt-get dist-upgrade -y
- DEBIAN_FRONTEND=noninteractive apt-get install -y scons git g++ wget unzip
#- DEBIAN_FRONTEND=noninteractive apt-get install -y libxcursor1 libxinerama1 libxrandr2 libxi6 libasound2 libpulse0 libgl1
#- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev libxrandr-dev yasm
- DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb libxcursor1 libxinerama1 libxrandr2 libxi6 libasound2 libpulse0 libgl1 mesa-utils libgl1-mesa-dri libasound2 libasound2-plugins alsa-utils alsa-oss pulseaudio pulseaudio-utils
- DEBIAN_FRONTEND=noninteractive apt-get install -y xterm libxcursor1 xcursor-themes icon-slicer libpulse0
- DEBIAN_FRONTEND=noninteractive apt-get install -y lxde strace
- DEBIAN_FRONTEND=noninteractive apt-get install -y task-gnome-desktop
- DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb libxcursor-dev libxinerama1 libxrandr2 libxi6 libasound2 libpulse0 libgl1-mesa-glx
- DEBIAN_FRONTEND=noninteractive apt-get install -y x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps
# libpng-tools libpng16-16 libpng-dev build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev libxrandr-dev yasm
- git submodule update --init --recursive
# - godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
- scons -j$(nproc) -C godot-cpp platform=linux target=release generate_bindings=yes custom_api_file=godot_headers/api.json bits=64
- scons -j$(nproc) -C gdnative platform=linux target=release bits=64
- ls -la gdnative/bin
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_x11.64.zip
- unzip /tmp/Godot_v${GODOT_VERSION}-stable_x11.64.zip -d /tmp
- mv /tmp/Godot_v${GODOT_VERSION}-stable_x11.64 /usr/local/bin/godot
# Start Audio server
- pulseaudio -D
# Start X11 server (and launch build)
- pwd
- echo "WORKDIR:$WORKDIR"
- mkdir -p .import /tmp/data/godot/app_userdata/Khanat/logs
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
- ls $WORKDIR/assets/GUI/images/Login-Khanat-background.png
- xvfb-run -a -n 99 --server-args="-ac -screen 0 1024x768x24 +extension GLX +render -noreset" strace /usr/local/bin/godot -v --editor --quit
- ls -la assets/GUI/images/
- ls -la .import/ || echo ""
#- xvfb-run -a -n 99 --server-args="-ac -screen 0 1024x768x24 +extension GLX +render -noreset" /usr/local/bin/godot --quit -v --path $WORKDIR --export khaganat.linux.64 khaganat.linux64.bin
#- ls -la assets/GUI/images/
#- ls -la .import/ || echo ""
#- ls -la || echo ""
#- xvfb-run -a -n 99 --server-args="-ac -screen 0 1024x768x24 +extension GLX +render -noreset" xdpyinfo -display :99
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-client-linux-64"
paths:
- khaganat.linux64.*
when: manual
Build Client Linux 64 (headless method):
# Other method to build, but currently doesn't work -> "X11 Display is not available"
stage: build
tags:
- Docker
image: amd64/debian:10
script:
- export -p WORKDIR=$PWD
- apt-get update
- apt-get dist-upgrade -y
- DEBIAN_FRONTEND=noninteractive apt-get install -y scons git g++ wget unzip
#- DEBIAN_FRONTEND=noninteractive apt-get install -y libxcursor1 libxinerama1 libxrandr2 libxi6 libasound2 libpulse0 libgl1
#- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev libxrandr-dev yasm
- git submodule update --init --recursive
# - godot --gdnative-generate-json-api godot-cpp/godot_headers/api.json
- scons -j$(nproc) -C godot-cpp platform=linux target=release generate_bindings=yes custom_api_file=godot_headers/api.json bits=64
- scons -j$(nproc) -C gdnative platform=linux target=release bits=64
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
- wget -q -P /tmp https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
- mkdir -p ~/.cache ~/.config/godot ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- unzip /tmp/Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip -d /tmp
- mv /tmp/Godot_v${GODOT_VERSION}-stable_linux_headless.64 /usr/local/bin/godot
- unzip /tmp/Godot_v${GODOT_VERSION}-stable_export_templates.tpz -d /tmp
- mv /tmp/templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- rm -f Godot_v${GODOT_VERSION}-stable_export_templates.tpz Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
- /usr/local/bin/godot -v --path . --export khaganat.linux.64 khaganat.linux64.bin
# - /usr/local/bin/godot -v --no-window --disable-render-loop --path . --export khaganat.linux.64 khaganat.linux64.bin
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-client-linux-64"
paths:
- khaganat.linux64.*
when: manual