Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Laguna1989 authored Aug 25, 2024
0 parents commit c46cbf6
Show file tree
Hide file tree
Showing 895 changed files with 89,107 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
BasedOnStyle: WebKit
Language: Cpp
PointerAlignment: Left
SpaceBeforeParens: ControlStatements
SpacesInParentheses: 'false'
SeparateDefinitionBlocks: Always
Standard: c++14
UseTab: Never
ColumnLimit: 100
FixNamespaceComments: 'true'
NamespaceIndentation: 'None'
AlwaysBreakTemplateDeclarations: 'Yes'
QualifierAlignment: Right


SortIncludes: 'true'
IncludeCategories:
- Regex: '"*(.hpp)"'
Priority: 2
- Regex: '<*(.hpp)>'
Priority: 2
- Regex: '^((?!(.hpp)).)*$'
Priority: 4
- Regex: '(<SFML)'
Priority: 1
...
24 changes: 24 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Checks": "-*,
abseil*,
altera*,
android*,
boost*,
bugprone*,
cert*,
-cert-err58-cpp,
-cert-msc32-c,
-cert-msc51-cpp,
clang-analyzer*,
-fuchsia-*,
google*,
-google-default-arguments,
hicpp*,
-hicpp-uppercase-literal-suffix,
-llvm*",
"WarningsAsErrors": "false",
"CheckOptions": [
{ "key": "performance-unnecessary-value-param.AllowedTypes",
"value": "shared_ptr;Sptr" }
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ext/* linguist-vendored
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
215 changes: 215 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
name: Deployment

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write


jobs:
WindowsSFML:
runs-on: windows-2019
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.x'

- uses: actions/checkout@v4

- uses: seanmiddleditch/gha-setup-ninja@master

- name: CMake
run: cmake -B ${{github.workspace}}/build -DJT_ENABLE_UNITTESTS=OFF -DCMAKE_BUILD_TYPE=Release -DJT_ENABLE_DEBUG=OFF -DJT_ENABLE_DEMOS=OFF -DNOMINMAX=ON -DJT_ENABLE_LTO_OPTIMIZATION=ON .

- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release --parallel

- name: Copy files
run: |
mkdir ${{github.workspace}}/release
mkdir ${{github.workspace}}/release/release_win
cp ${{github.workspace}}/build/impl/game/Release/*.exe ${{github.workspace}}/release/release_win/
cp ${{github.workspace}}/build/impl/game/Release/*.dll ${{github.workspace}}/release/release_win/
cp -r ${{github.workspace}}/build/impl/game/assets ${{github.workspace}}/release/release_win/
- name: Create Archive
uses: thedoctor0/[email protected]
with:
directory: ${{github.workspace}}/release
type: 'zip'
filename: 'release_win_${{github.ref_name}}.zip'

- name: Release
uses: softprops/[email protected]
with:
files: ${{github.workspace}}\release\release_win_${{github.ref_name}}.zip

LinuxSFML:
runs-on: ubuntu-latest
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.x'

- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Set up system libs
run: |
sudo apt update && \
sudo apt-get install -y \
xorg-dev \
libudev-dev \
libopenal-dev \
x11-xserver-utils \
libfreetype-dev \
libudev-dev
- name: CMake
run: |
cmake -G Ninja \
-B ${{github.workspace}}/build \
-DJT_ENABLE_UNITTESTS=OFF \
-DJT_ENABLE_DEBUG=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DJT_ENABLE_DEMOS=OFF \
-DJT_ENABLE_LTO_OPTIMIZATION=ON \
-DJT_ENABLE_FINAL_OPTIMIZATION=ON \
.
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release

- name: Copy files
run: |
export RELEASE_NAME=$(echo "${GITHUB_REPOSITORY}" | sed 's/^[^\/]*\///g')
mkdir -p ${{github.workspace}}/release/${RELEASE_NAME}_linux
cd ${{github.workspace}}/build/impl/game/
rsync -avr --exclude="Makefile" --exclude="CMakeFiles" --exclude="*.cmake" . ${{github.workspace}}/release/${RELEASE_NAME}_linux
cd ${{github.workspace}}/release
tar -czvf ${{github.workspace}}/release/release_linux_${{github.ref_name}}.tar.gz ${RELEASE_NAME}_linux
- name: Release
uses: softprops/[email protected]
with:
files: ${{github.workspace}}/release/release_linux_${{github.ref_name}}.tar.gz

WebSDL:
runs-on: ubuntu-latest
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.x'

- name: Set up gcc
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.56

- uses: actions/checkout@v4

- name: CMake
run: |
emcmake cmake \
-B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-DJT_ENABLE_DEBUG=OFF \
-DJT_ENABLE_DEMOS=OFF \
-DJT_ENABLE_UNITTESTS=OFF \
-DJT_ENABLE_WEB=ON \
-DUSE_SFML=OFF .
- name: BuildFirst
working-directory: ${{github.workspace}}/build
run: emmake make Box2D

- name: BuildAll
working-directory: ${{github.workspace}}/build
run: emmake make -j

- name: Copy index.html
run: cp ${{github.workspace}}/index.html ${{github.workspace}}/build/impl/game/index.html

- name: Copy files
run: |
mkdir ${{github.workspace}}/release
mkdir ${{github.workspace}}/release/release_web
cp ${{github.workspace}}/index.html ${{github.workspace}}/release/release_web/
cp ${{github.workspace}}/reset.css ${{github.workspace}}/release/release_web/
cp ${{github.workspace}}/build/impl/game/*.data ${{github.workspace}}/release/release_web/
cp ${{github.workspace}}/build/impl/game/*.js ${{github.workspace}}/release/release_web/
cp ${{github.workspace}}/build/impl/game/*.wasm ${{github.workspace}}/release/release_web/
- name: Create Archive
uses: thedoctor0/zip-release@master
with:
directory: ${{github.workspace}}/release/release_web
type: 'zip'
filename: 'release_web_${{github.ref_name}}.zip'

- name: Release
uses: softprops/[email protected]
with:
files: ${{github.workspace}}/release/release_web/release_web_${{github.ref_name}}.zip

Mac_SFML:
runs-on: macos-latest
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.x'

- name: Install dependencies
run: |
brew install cmake ninja
- uses: actions/checkout@v4

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.os }}
max-size: 200M

- name: CMake
run: |
cmake \
-DJT_ENABLE_DEMOS=OFF \
-DJT_ENABLE_DEBUG=OFF \
-DJT_ENABLE_UNITTESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-B ${{github.workspace}}/build .
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release

- name: Copy files
run: |
export RELEASE_NAME=$(echo "${GITHUB_REPOSITORY}" | sed 's/^[^\/]*\///g')
mkdir -p ${{github.workspace}}/release/${RELEASE_NAME}_mac
cd ${{github.workspace}}/build/impl/game/
rsync -avr --exclude="Makefile" --exclude="CMakeFiles" --exclude="*.cmake" . ${{github.workspace}}/release/${RELEASE_NAME}_mac
cd ${{github.workspace}}/release
tar -czvf ${{github.workspace}}/release/release_mac_${{github.ref_name}}.tar.gz ${RELEASE_NAME}_mac
- name: Release
uses: softprops/[email protected]
with:
files: ${{github.workspace}}/release/release_mac_${{github.ref_name}}.tar.gz
79 changes: 79 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Performance Measurement

on:
push:
branches: [ master ]

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

jobs:
PerformanceBenchmark:
runs-on: ubuntu-latest
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26.x'

- name: Set up gcc
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Set up system libs
run: |
sudo apt-get install -y \
libsfml-dev \
jackd \
libx11-dev \
xorg-dev \
freeglut3-dev \
libudev-dev \
libopenal-dev \
libvorbis-dev \
libfreetype-dev \
libflac-dev
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.type }}
max-size: 100M

- name: CMake
run: |
cmake \
-G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DJT_ENABLE_DEBUG=OFF \
-DJT_ENABLE_PERFORMANCETESTS=ON .
- name: Build
run: ninja -j 8 jt_performance

- name: Execute Performance Test
working-directory: ${{github.workspace}}/test/integration/performance
run: export LD_LIBRARY_PATH=${{github.workspace}}/test/integration/performance && xvfb-run ./jt_performance --benchmark_format=json --benchmark_out=benchmark_result.json

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'googlecpp'
# Where the output from the benchmark tool is stored
output-file-path: ${{github.workspace}}/test/integration/performance/benchmark_result.json
# Workflow will fail when an alert happens
fail-on-alert: true
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
Loading

0 comments on commit c46cbf6

Please sign in to comment.