From a9e3a4029a4c0863d4a2a537aca0900cd5e115cb Mon Sep 17 00:00:00 2001 From: Learath Date: Thu, 23 Jan 2020 16:01:52 +0100 Subject: [PATCH 1/3] Migrate to Github Actions --- .circleci/config.yml | 120 ----------------------------------- .github/workflows/build.yaml | 100 +++++++++++++++++++++++++++++ .travis.yml | 35 ---------- appveyor.yml | 51 --------------- 4 files changed, 100 insertions(+), 206 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yaml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 09d9c22c9..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: 2 -defaults: &defaults - working_directory: ~/ddnet/ddnet - docker: - - image: buildpack-deps:stretch - -defignore: &defignore - filters: - branches: - ignore: - - /.*\.tmp/ - -jobs: - pre_test: - <<: *defaults - parallelism: 1 - steps: - - checkout - - run: python scripts/check_header_guards.py - - build: - <<: *defaults - parallelism: 1 - #environment: - #CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - #CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - - steps: - - checkout - #- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - - run: git submodule update --init - - - run: | - apt-get update - apt-get install -y build-essential \ - python3 \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libsdl2-dev \ - libglew-dev \ - libogg-dev \ - libopus-dev \ - libpnglite-dev \ - libopusfile-dev \ - libwavpack-dev \ - libwebsockets-dev \ - libmysqlcppconn-dev - apt-get install -y cmake xz-utils - - # Compile - - run: python scripts/check_header_guards.py - - run: | - mkdir build - cd build - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DDOWNLOAD_GTEST=ON .. - make everything - make package_default - mkdir -p /tmp/artifacts - cp DDNet-*-linux_x86_64.tar.xz /tmp/artifacts - - run: | - mkdir noautoupdate - cd noautoupdate - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DAUTOUPDATE=OFF -DDOWNLOAD_GTEST=ON .. - make everything - - run: | - mkdir websockets - cd websockets - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DWEBSOCKETS=ON -DDOWNLOAD_GTEST=ON .. - make everything - - run: | - mkdir mysql - cd mysql - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DDMYSQL=ON -DDOWNLOAD_GTEST=ON .. - make everything - - run: | - mkdir bundled - cd bundled - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DPREFER_BUNDLED_LIBS=ON -DDOWNLOAD_GTEST=ON .. - make everything - - - store_artifacts: - path: /tmp/artifacts - - - persist-to-workspace: - root: ./ - paths: ./* - - test: - <<: *defaults - steps: - - attach-workspace: - at: ./ - - - run: | - apt-get update - apt-get install -y make cmake xz-utils - - - run: | - cd build - make run_tests - ./DDNet-Server shutdown - - - run: | - cd noautoupdate - make run_tests - -workflows: - version: 2 - build_and_test: - jobs: - - pre_test: - <<: *defignore - - build: - <<: *defignore - requires: - - pre_test - - test: - <<: *defignore - requires: - - build diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..e5d5b2138 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,100 @@ +name: Build + +on: [push, pull_request] + +jobs: + build-cmake: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest, ubuntu-16.04] + include: + - os: ubuntu-latest + cmake-args: -G "Unix Makefiles" + build-args: --parallel + package-file: DDNet-Server-*-linux_x86_64.tar.xz + env: + CFLAGS: -Wdeclaration-after-statement -Werror + CXXFLAGS: -Werror + - os: ubuntu-16.04 + cmake-path: /usr/bin/ + cmake-args: -G "Unix Makefiles" + package-file: DDNet-Server-*-linux_x86_64.tar.xz + env: + CFLAGS: -Wdeclaration-after-statement -Werror + CXXFLAGS: -Werror + - os: macOS-latest + cmake-args: -G "Unix Makefiles" + build-args: --parallel + package-file: DDNet-Server-*-osx.dmg + env: + CFLAGS: -Wdeclaration-after-statement -Werror + CXXFLAGS: -Werror + - os: windows-latest + cmake-args: -G "Visual Studio 16 2019" -A x64 + package-file: DDNet-Server-*-win64.zip + env: + CFLAGS: /WX + CXXFLAGS: /WX + LDFLAGS: /WX + + steps: + - uses: actions/checkout@v2 + - name: Checkout submodules + shell: bash + run: | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + + - name: Prepare Linux + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get update -y + sudo apt-get install pkg-config cmake libfreetype6-dev libsdl2-dev -y + + - name: Prepare MacOS + if: contains(matrix.os, 'macOS') + run: | + brew update + brew install pkg-config freetype sdl2 + + - 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=. .. + ${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }} --target everything + - name: Test debug + run: | + cd debug + ${{ matrix.cmake-path }}cmake --build . --config Debug ${{ matrix.build-args }} --target run_tests + ./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=. .. + ${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target everything + - name: Test release + run: | + cd release + ${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target run_tests + ./DDNet-Server shutdown + + - name: Package + run: | + cd release + ${{ matrix.cmake-path }}cmake --build . --config Release ${{ matrix.build-args }} --target package_default + mkdir artifacts + mv ${{ matrix.package-file }} artifacts + + - name: Upload Artifacts + uses: actions/upload-artifact@v1 + with: + name: ddnet-${{ matrix.os }} + path: release/artifacts diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cfc309195..000000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: c++ -sudo: false -dist: trusty -os: -- linux -- osx -addons: - apt: - packages: - - libfreetype6-dev - - libgtest-dev - - libsdl2-dev -script: -- python scripts/check_header_guards.py -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then CMAKE_EXTRA_ARGS="-DDOWNLOAD_GTEST=ON -DDEV=ON"; fi -- if [ "$TRAVIS_OS_NAME" != "osx" ]; then CMAKE_EXTRA_ARGS="-DGTEST_LIBRARY=../gtest_build/libgtest.a -DGTEST_MAIN_LIBRARY=../gtest_build/libgtest_main.a"; mkdir gtest_build; cmake -E chdir gtest_build cmake /usr/src/gtest; cmake --build gtest_build; fi -- mkdir build; cd build -- cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=/usr $CMAKE_EXTRA_ARGS .. -- make everything -- make run_tests -- if [ "$TRAVIS_OS_NAME" != "osx" ]; then make DESTDIR=install install; test -x install/bin/DDNet; test -x install/bin/DDNet-Server; test -d install/bin/data; test -d install/usr/lib; fi -- make package_default -- cd ..; mkdir build_debug; cd build_debug -- cmake -Werror=dev -DCMAKE_BUILD_TYPE=Debug $CMAKE_EXTRA_ARGS .. -- make run_tests -- cd .. -- build/DDNet-Server shutdown -env: - global: - - CFLAGS="-Wdeclaration-after-statement -Werror" - - CXXFLAGS="-Werror" -branches: - except: - - staging.tmp - - testing.tmp diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f1d8426c3..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,51 +0,0 @@ -image: Visual Studio 2015 - -before_build: -- cmd: | - git submodule update --init - - scripts\check_header_guards.py - - md build32 & cd build32 - cmake -Werror=dev -G "Visual Studio 14 2015" .. - cd .. - - md build64 & cd build64 - cmake -Werror=dev -G "Visual Studio 14 2015 Win64" .. - cd .. - -build_script: - - cmd: cmake --build build32 --config Release --target everything - - cmd: cmake --build build64 --config Release --target everything - -test_script: - - cmd: cmake --build build32 --config Debug --target run_tests - - cmd: cmake --build build64 --config Debug --target run_tests - - cmd: cmake --build build32 --config Release --target run_tests - - cmd: cmake --build build64 --config Release --target run_tests - - cmd: | - cd build32 - Release\DDNet-Server shutdown - cd .. - - cmd: | - cd build64 - Release\DDNet-Server shutdown - cd .. - -after_build: - - cmd: cmake --build build32 --config Release --target package - - cmd: cmake --build build64 --config Release --target package - -environment: - CFLAGS: /WX - CXXFLAGS: /WX - LDFLAGS: /WX - -artifacts: - - path: build*/DDNet-*.zip - name: DDNet - -branches: - except: - - staging.tmp - - testing.tmp From 4451fed53532fc7d41da99c1bbb7c49fd10ceb70 Mon Sep 17 00:00:00 2001 From: Learath Date: Thu, 23 Jan 2020 16:07:40 +0100 Subject: [PATCH 2/3] Fix missing include --- src/game/server/score/file_score.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/server/score/file_score.h b/src/game/server/score/file_score.h index 235651fa5..715d11f03 100644 --- a/src/game/server/score/file_score.h +++ b/src/game/server/score/file_score.h @@ -6,6 +6,7 @@ #include +#include #include "../score.h" class CFileScore: public IScore From 696532689c8d29554626f70862dff65b0bef4799 Mon Sep 17 00:00:00 2001 From: Learath Date: Thu, 23 Jan 2020 16:13:54 +0100 Subject: [PATCH 3/3] Fix package names --- .github/workflows/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e5d5b2138..162c70556 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,27 +12,27 @@ jobs: - os: ubuntu-latest cmake-args: -G "Unix Makefiles" build-args: --parallel - package-file: DDNet-Server-*-linux_x86_64.tar.xz + package-file: DDNet-*-linux_x86_64.tar.xz env: CFLAGS: -Wdeclaration-after-statement -Werror CXXFLAGS: -Werror - os: ubuntu-16.04 cmake-path: /usr/bin/ cmake-args: -G "Unix Makefiles" - package-file: DDNet-Server-*-linux_x86_64.tar.xz + package-file: DDNet-*-linux_x86_64.tar.xz env: CFLAGS: -Wdeclaration-after-statement -Werror CXXFLAGS: -Werror - os: macOS-latest cmake-args: -G "Unix Makefiles" build-args: --parallel - package-file: DDNet-Server-*-osx.dmg + package-file: DDNet-*-osx.dmg env: CFLAGS: -Wdeclaration-after-statement -Werror CXXFLAGS: -Werror - os: windows-latest cmake-args: -G "Visual Studio 16 2019" -A x64 - package-file: DDNet-Server-*-win64.zip + package-file: DDNet-*-win64.zip env: CFLAGS: /WX CXXFLAGS: /WX