2020-01-23 15:01:52 +00:00
|
|
|
name: Build
|
|
|
|
|
2020-06-30 23:50:40 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- staging.tmp
|
|
|
|
- trying.tmp
|
|
|
|
- staging-squash-merge.tmp
|
|
|
|
pull_request:
|
2020-01-23 15:01:52 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-cmake:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2020-04-10 19:01:39 +00:00
|
|
|
fail-fast: false
|
2020-01-23 15:01:52 +00:00
|
|
|
matrix:
|
2021-12-19 22:08:27 +00:00
|
|
|
os: [ubuntu-latest, macOS-latest, windows-latest, ubuntu-18.04]
|
2020-01-23 15:01:52 +00:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
cmake-args: -G "Unix Makefiles"
|
|
|
|
build-args: --parallel
|
2020-01-23 15:13:54 +00:00
|
|
|
package-file: DDNet-*-linux_x86_64.tar.xz
|
2020-05-16 23:04:49 +00:00
|
|
|
fancy: true
|
2020-01-23 15:01:52 +00:00
|
|
|
env:
|
|
|
|
CFLAGS: -Wdeclaration-after-statement -Werror
|
|
|
|
CXXFLAGS: -Werror
|
2021-12-19 22:08:27 +00:00
|
|
|
- os: ubuntu-18.04
|
2020-01-23 15:01:52 +00:00
|
|
|
cmake-path: /usr/bin/
|
|
|
|
cmake-args: -G "Unix Makefiles"
|
2020-01-23 15:13:54 +00:00
|
|
|
package-file: DDNet-*-linux_x86_64.tar.xz
|
2020-05-16 23:04:49 +00:00
|
|
|
fancy: false
|
2020-01-23 15:01:52 +00:00
|
|
|
env:
|
|
|
|
CFLAGS: -Wdeclaration-after-statement -Werror
|
|
|
|
CXXFLAGS: -Werror
|
2021-12-19 23:00:38 +00:00
|
|
|
GTEST_FILTER: -*SQLite*
|
2020-01-23 15:01:52 +00:00
|
|
|
- os: macOS-latest
|
|
|
|
cmake-args: -G "Unix Makefiles"
|
|
|
|
build-args: --parallel
|
2021-12-04 12:26:12 +00:00
|
|
|
package-file: DDNet-*-macos.dmg
|
2020-05-16 23:04:49 +00:00
|
|
|
fancy: false
|
2020-01-23 15:01:52 +00:00
|
|
|
env:
|
|
|
|
CFLAGS: -Wdeclaration-after-statement -Werror
|
|
|
|
CXXFLAGS: -Werror
|
|
|
|
- os: windows-latest
|
|
|
|
cmake-args: -G "Visual Studio 16 2019" -A x64
|
2020-01-23 15:13:54 +00:00
|
|
|
package-file: DDNet-*-win64.zip
|
2020-05-16 23:04:49 +00:00
|
|
|
fancy: false
|
2020-01-23 15:01:52 +00:00
|
|
|
env:
|
|
|
|
CFLAGS: /WX
|
|
|
|
CXXFLAGS: /WX
|
|
|
|
LDFLAGS: /WX
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-09-19 19:16:10 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-01-23 15:01:52 +00:00
|
|
|
|
|
|
|
- name: Prepare Linux
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update -y
|
2020-07-08 19:09:52 +00:00
|
|
|
sudo apt-get install pkg-config cmake libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev -y
|
2020-01-23 15:01:52 +00:00
|
|
|
|
2020-05-16 23:04:49 +00:00
|
|
|
- name: Prepare Linux (fancy)
|
|
|
|
if: contains(matrix.os, 'ubuntu') && matrix.fancy
|
|
|
|
run: |
|
2021-11-28 00:41:10 +00:00
|
|
|
sudo apt-get install libmariadbclient-dev libwebsockets-dev mariadb-server -y
|
|
|
|
sudo rm -rf /var/lib/mysql/
|
|
|
|
sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql/
|
|
|
|
cd /usr; sudo /usr/bin/mysqld_safe --datadir='/var/lib/mysql/' --no-watch
|
|
|
|
sleep 10
|
|
|
|
sudo mariadb <<EOF
|
|
|
|
CREATE DATABASE ddnet;
|
|
|
|
CREATE USER 'ddnet'@'localhost' IDENTIFIED BY 'thebestpassword';
|
|
|
|
GRANT ALL PRIVILEGES ON ddnet.* TO 'ddnet'@'localhost';
|
|
|
|
FLUSH PRIVILEGES;
|
|
|
|
EOF
|
2020-05-16 23:04:49 +00:00
|
|
|
|
2021-07-08 07:08:08 +00:00
|
|
|
- name: Prepare macOS
|
2020-01-23 15:01:52 +00:00
|
|
|
if: contains(matrix.os, 'macOS')
|
|
|
|
run: |
|
2020-09-29 17:16:23 +00:00
|
|
|
brew update || true
|
2020-06-24 09:51:32 +00:00
|
|
|
brew install pkg-config sdl2
|
|
|
|
brew upgrade freetype
|
2020-05-01 08:31:30 +00:00
|
|
|
sudo rm -rf /Library/Developer/CommandLineTools
|
2020-01-23 15:01:52 +00:00
|
|
|
|
|
|
|
- name: Build in debug mode
|
|
|
|
env: ${{ matrix.env }}
|
|
|
|
run: |
|
|
|
|
mkdir debug
|
|
|
|
cd debug
|
|
|
|
${{ matrix.cmake-path }}cmake --version
|
|
|
|
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Debug --target everything ${{ matrix.build-args }}
|
2020-01-23 15:01:52 +00:00
|
|
|
- name: Test debug
|
2021-12-19 22:08:27 +00:00
|
|
|
env: ${{ matrix.env }}
|
2020-01-23 15:01:52 +00:00
|
|
|
run: |
|
|
|
|
cd debug
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Debug --target run_tests ${{ matrix.build-args }}
|
2020-01-23 15:01:52 +00:00
|
|
|
./DDNet-Server shutdown
|
|
|
|
|
|
|
|
- name: Build in release mode
|
|
|
|
env: ${{ matrix.env }}
|
|
|
|
run: |
|
|
|
|
mkdir release
|
|
|
|
cd release
|
|
|
|
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -Werror=dev -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. ..
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Release --target everything ${{ matrix.build-args }}
|
2020-01-23 15:01:52 +00:00
|
|
|
- name: Test release
|
2021-12-19 22:08:27 +00:00
|
|
|
env: ${{ matrix.env }}
|
2020-01-23 15:01:52 +00:00
|
|
|
run: |
|
|
|
|
cd release
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Release --target run_tests ${{ matrix.build-args }}
|
2020-01-23 15:01:52 +00:00
|
|
|
./DDNet-Server shutdown
|
|
|
|
|
2021-09-30 09:48:44 +00:00
|
|
|
- name: Build headless client
|
|
|
|
env: ${{ matrix.env }}
|
|
|
|
run: |
|
|
|
|
mkdir headless
|
|
|
|
cd headless
|
|
|
|
${{ matrix.cmake-path }}cmake --version
|
|
|
|
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. ..
|
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }}
|
|
|
|
- name: Test headless client
|
|
|
|
run: |
|
|
|
|
cd headless
|
|
|
|
./DDNet-Server &
|
|
|
|
./DDNet "cl_download_skins 0;connect localhost:8303;quit"
|
|
|
|
|
2020-05-16 23:04:49 +00:00
|
|
|
- name: Build in release mode with debug info and all features on
|
|
|
|
if: matrix.fancy
|
|
|
|
env: ${{ matrix.env }}
|
|
|
|
run: |
|
|
|
|
mkdir fancy
|
|
|
|
cd fancy
|
2021-11-28 15:05:57 +00:00
|
|
|
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DANTIBOT=ON -DTEST_MYSQL=ON -DWEBSOCKETS=ON ..
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target everything ${{ matrix.build-args }}
|
2020-05-16 23:04:49 +00:00
|
|
|
- name: Test fancy
|
|
|
|
if: matrix.fancy
|
2021-12-19 22:08:27 +00:00
|
|
|
env: ${{ matrix.env }}
|
2020-05-16 23:04:49 +00:00
|
|
|
run: |
|
2021-11-28 15:05:57 +00:00
|
|
|
cd fancy
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target run_tests ${{ matrix.build-args }}
|
2020-05-16 23:04:49 +00:00
|
|
|
./DDNet-Server shutdown
|
|
|
|
|
2020-01-23 15:01:52 +00:00
|
|
|
- name: Package
|
|
|
|
run: |
|
|
|
|
cd release
|
2021-04-07 16:07:44 +00:00
|
|
|
${{ matrix.cmake-path }}cmake --build . --config Release --target package_default ${{ matrix.build-args }}
|
2020-01-23 15:01:52 +00:00
|
|
|
mkdir artifacts
|
|
|
|
mv ${{ matrix.package-file }} artifacts
|
|
|
|
|
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: ddnet-${{ matrix.os }}
|
|
|
|
path: release/artifacts
|