Skip to content

Commit

Permalink
Initialize tw07server
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-Chara authored Jun 10, 2024
0 parents commit 652f6ed
Show file tree
Hide file tree
Showing 236 changed files with 53,279 additions and 0 deletions.
159 changes: 159 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Build

on: [push, pull_request]

jobs:
build-cmake:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest, ubuntu-18.04]
include:
- os: ubuntu-latest
cmake-args: -G "Unix Makefiles"
build-args: --parallel
package-file: teeworlds-*-linux_x86_64.tar.xz
env:
CFLAGS: -Wdeclaration-after-statement -Werror
CXXFLAGS: -Werror
- os: ubuntu-18.04
cmake-path: /usr/bin/
cmake-args: -G "Unix Makefiles"
package-file: teeworlds-*-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: teeworlds-*-osx.dmg
env:
CFLAGS: -Wdeclaration-after-statement -Werror
CXXFLAGS: -Werror
- os: windows-latest
cmake-args: -A x64
package-file: teeworlds-*-win64.zip
env:
CFLAGS: /WX
CXXFLAGS: /WX
LDFLAGS: /WX

steps:
- uses: actions/checkout@v2
with:
submodules: true

- 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 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
- name: Run debug server
env: ${{ matrix.env }}
run: |
cd debug
./teeworlds_srv 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
- name: Run release server
env: ${{ matrix.env }}
run: |
cd release
./teeworlds_srv 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: teeworlds-${{ matrix.os }}
path: release/artifacts

build-bam:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Checkout bam
uses: actions/checkout@v2
with:
repository: matricks/bam
ref: 8cd08744c37666830d439ab54016c9d228c63b68
path: ./bam

- name: Prepare Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install libfreetype6-dev libsdl2-dev -y
cd bam
./make_unix.sh
- name: Prepare MacOS
if: contains(matrix.os, 'macOS')
run: |
brew update
brew install sdl2
cd bam
./make_unix.sh
- name: Prepare Windows
if: contains(matrix.os, 'windows')
run: |
cd bam
./make_win64_msvc.bat
- name: Build in debug mode
run: ./bam/bam conf=debug all
- name: Test debug
run: ./build/x86_64/debug/teeworlds_srv shutdown

- name: Build in release mode
run: ./bam/bam conf=release all
- name: Test release
run: ./build/x86_64/release/teeworlds_srv shutdown

- name: Create MacOS app using make_release.py
if: contains(matrix.os, 'macOS')
run: |
sudo python3 scripts/make_release.py master osx
31 changes: 31 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check style

on:
push:
branches-ignore:
- master
- staging.tmp
- trying.tmp
- staging-squash-merge.tmp
pull_request:

jobs:
check-style:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare
run: |
sudo apt-get update -y
sudo apt-get install jq -y
- name: Check header guards
run: scripts/check_header_guards.py
- name: Lint JSON
run: |
while read -r json;
do
jq '.' "$json" || { echo "$json"; exit 1; };
done < <(find . -name "*.json");
77 changes: 77 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/.bam
/bam
/build
/config.lua
/objs
/other/*/include
/other/*/lib
/other/*/linux
/other/*/mac
/other/*/windows
__pycache__/
*.dll
*.dmg
*.pyc
*.pyo
scripts/work/
/SDL.dll
/freetype.dll
/autoexec.cfg
other/freetype
other/sdl
Info.plist

crapnet*
fake_server*
map_resave*
map_version*
mastersrv*
packetgen*
teeworlds*
!other/bash-completion/teeworlds
!teeworlds.manifest
!teeworlds.rc
teeworlds_srv*
!other/bash-completion/teeworlds_srv
testrunner
versionsrv*

# IDE project files
.cproject
.idea
.project
.settings
.vs
.vscode
*.vcxproj
*.vcxproj.filters
compile_commands.json
cscope.files
cscope.out
out
tags

# CMake
data
generated

.ninja_deps
.ninja_log
CMakeCache.txt
CMakeFiles
CMakeSettings*
CPackConfig.cmake
CPackSourceConfig.cmake
Debug
Makefile
RelWithDebInfo
Release
_CPack_Packages/
build.ninja
cmake_install.cmake
googletest-build
googletest-download
googletest-src
install_manifest.txt
pack_*/
rules.ninja
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "datasrc/languages"]
path = datasrc/languages
url = https://github.com/teeworlds/teeworlds-translation.git
branch = master
[submodule "datasrc/maps"]
path = datasrc/maps
url = https://github.com/teeworlds/teeworlds-maps.git
branch = master
Loading

0 comments on commit 652f6ed

Please sign in to comment.