Skip to content

Commit

Permalink
Merge branch 'master' into pr/3385
Browse files Browse the repository at this point in the history
  • Loading branch information
EPuncker committed May 8, 2022
2 parents ef32e4a + 43c1cdf commit 44c166c
Show file tree
Hide file tree
Showing 421 changed files with 36,564 additions and 25,084 deletions.
21 changes: 21 additions & 0 deletions .clang-format
@@ -0,0 +1,21 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -4
AlignEscapedNewlines: DontAlign
BreakBeforeBraces: Mozilla
BreakConstructorInitializers: AfterColon
BreakStringLiterals: false
ColumnLimit: 120
IncludeCategories:
- Regex: '^"otpch\.h"$'
Priority: -1
- Regex: '^".*"$'
Priority: 1
- Regex: '^<.*>$'
Priority: 2
IndentWidth: 4
SpacesBeforeTrailingComments: 1
TabWidth: 4
UseTab: ForIndentation
...
13 changes: 1 addition & 12 deletions .editorconfig
Expand Up @@ -4,19 +4,8 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.{cpp,h,lua,xml}]
indent_style = tab
[*.{lua,xml}]
indent_size = 4

[**.{.cpp,.h}]
# Options not ubiquitous, but useful
indent_brace_style = K&R
spaces_around_brackets = none

[.travis.yml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Expand Up @@ -14,5 +14,5 @@ about: Requesting a new feature for the engine or data pack
<!-- If you know of any weird/hacky way to do what you want currently, explain. -->

### Prior art
<!-- If what you are asking for has been previously implemented, provide linkes
<!-- If what you are asking for has been previously implemented, provide links
and description of what/how/where/when. -->
4 changes: 1 addition & 3 deletions .github/workflows/build-ubuntu.yml
Expand Up @@ -6,9 +6,6 @@ on:
- master
- v*

tags:
- v*

paths:
- cmake/**
- src/**
Expand All @@ -29,6 +26,7 @@ jobs:

- name: Install dependencies
run: >
sudo apt-get update &&
sudo apt-get install git cmake build-essential libluajit-5.1-dev libmysqlclient-dev
libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libboost-filesystem-dev
libpugixml-dev libcrypto++-dev libfmt-dev
Expand Down
119 changes: 90 additions & 29 deletions .github/workflows/build-vcpkg.yml
Expand Up @@ -6,9 +6,6 @@ on:
- master
- v*

tags:
- v*

paths:
- cmake/**
- src/**
Expand All @@ -21,25 +18,17 @@ on:
- CMakeLists.txt

jobs:
job:
unix:
name: ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
max-parallel: 8
max-parallel: 10
matrix:
name: [ubuntu-gcc, ubuntu-clang, macos-clang, windows-msvc]
name: [ubuntu-gcc, ubuntu-clang, macos-clang]
buildtype: [Debug, Release]
luajit: [on, off]
include:
- name: windows-msvc
os: windows
cxx: cl.exe
cc: cl.exe
triplet: x64-windows
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua luajit libmariadb pugixml cryptopp fmt
- name: ubuntu-gcc
os: ubuntu
cxx: g++
Expand All @@ -64,6 +53,13 @@ jobs:
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua libmariadb pugixml cryptopp fmt
exclude:
- name: ubuntu-clang
buildtype: Release
- name: ubuntu-clang
luajit: off
- name: macos-clang
luajit: off

steps:
- uses: actions/checkout@v2
Expand All @@ -87,30 +83,27 @@ jobs:
run: brew install luajit pkgconfig
if: contains( matrix.os, 'macos')

- name: Windows - remove C:/mysql*
run: rm -r -fo C:/mysql-5.7.21-winx64
if: contains( matrix.os, 'windows')

- name: Set Environment vars
run: |
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
- name: Run vcpkg
uses: lukka/run-vcpkg@main
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{ matrix.packages }}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 7db401cb1ef1fc559ec9f9ce814d064c328fd767
appendedCacheKey: ${{ matrix.name }}${{ matrix.buildtype }}${{ matrix.luajit }}
vcpkgGitCommitId: 5568f110b509a9fd90711978a7cb76bae75bb092

- name: Build with CMake
uses: lukka/run-cmake@main
uses: lukka/run-cmake@v3
with:
useVcpkgToolchainFile: true
buildDirectory: ${{ runner.workspace }}/build
cmakeBuildType: ${{ matrix.buildtype }}
cmakeAppendedArgs: -DUSE_LUAJIT=${{ matrix.luajit }}
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE="${{ matrix.buildtype }}" -DUSE_LUAJIT="${{ matrix.luajit }}"'

- name: dir
run: find $RUNNER_WORKSPACE
Expand All @@ -121,21 +114,88 @@ jobs:
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/tfs
if: "! contains( matrix.os, 'windows')"

- name: Upload artifact binary (exe)
- name: Prepare datapack contents
run: find . -maxdepth 1 ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
shell: bash

- name: Upload datapack contents
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ github.workspace }}

windows:
name: ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.buildtype }}-luajit=on
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
max-parallel: 8
matrix:
name: [windows-msvc]
buildtype: [Debug, Release]
include:
- name: windows-msvc
os: windows
cxx: cl.exe
cc: cl.exe
triplet: x64-windows
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua luajit libmariadb pugixml cryptopp fmt
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Unshallow
run: git fetch --prune --unshallow

- name: Get latest CMake
# Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest

- name: Windows - remove C:/mysql*
run: rm -r -fo C:/mysql*

- name: Set Environment vars
run: |
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
- name: Run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{ matrix.packages }}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgTriplet: ${{ matrix.triplet }}
appendedCacheKey: ${{ matrix.name }}${{ matrix.buildtype }}${{ matrix.luajit }}
vcpkgGitCommitId: 5568f110b509a9fd90711978a7cb76bae75bb092

- name: Build with CMake
uses: lukka/run-cmake@v3
with:
useVcpkgToolchainFile: true
buildDirectory: ${{ runner.workspace }}/build
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE="${{ matrix.buildtype }}" -DUSE_LUAJIT="on"'

- name: dir
run: find $RUNNER_WORKSPACE
shell: bash

- name: Upload artifact binary (exe)
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=on-${{ github.sha }}
path: ${{ runner.workspace }}/build/tfs.exe
if: contains( matrix.os, 'windows')

- name: Upload artifact binary (dlls)
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=on-${{ github.sha }}
path: ${{ runner.workspace }}/build/*.dll
if: contains( matrix.os, 'windows')

- name: Prepare datapack contents
run: find . -maxdepth 1 ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
Expand All @@ -144,5 +204,6 @@ jobs:
- name: Upload datapack contents
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=on-${{ github.sha }}
path: ${{ github.workspace }}

30 changes: 30 additions & 0 deletions .github/workflows/clang-format.yml
@@ -0,0 +1,30 @@
name: Check code style

on:
push:
branches:
- master
- v*

paths:
- .clang-format
- src/**

pull_request:
paths:
- .clang-format
- src/**

jobs:
check-format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: >
sudo apt-get update &&
sudo apt-get install clang-format
- name: Check code style
run: clang-format -n -style=file --Werror src/*.{cpp,h}
2 changes: 2 additions & 0 deletions .github/workflows/lua-syntax.yml
Expand Up @@ -5,6 +5,8 @@ on:
paths:
- data/**.lua
push:
branches:
- master
paths:
- data/**.lua

Expand Down

0 comments on commit 44c166c

Please sign in to comment.