Skip to content

Commit

Permalink
Merge pull request #110 from albin-johansson/dev
Browse files Browse the repository at this point in the history
Merge dev into main for v6.3.0
  • Loading branch information
albin-johansson authored Oct 6, 2021
2 parents 20ee603 + e2c656b commit becc954
Show file tree
Hide file tree
Showing 286 changed files with 11,878 additions and 9,872 deletions.
30 changes: 20 additions & 10 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ IndentWidth: 2
---
Language: Cpp
Standard: c++20
ColumnLimit: 90

ColumnLimit: 95

DerivePointerAlignment: false
PointerAlignment: Left

AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AllowShortLambdasOnASingleLine: All
Expand All @@ -20,20 +23,27 @@ BinPackArguments: false

BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: true
AfterStruct: true
AfterClass: true
AfterStruct: true
AfterUnion: true
AfterEnum: true
AfterFunction: true
SplitEmptyRecord: false
SplitEmptyFunction: false
AfterExternBlock: true
AfterControlStatement: MultiLine
AfterCaseLabel: false
BeforeElse: true
AfterControlStatement: Always
BeforeCatch: true
SplitEmptyNamespace: false
SplitEmptyRecord: false
SplitEmptyFunction: false

BreakConstructorInitializers: BeforeComma
AllowAllConstructorInitializersOnNextLine: false
EmptyLineBeforeAccessModifier: Always

NamespaceIndentation: None
FixNamespaceComments: true

BreakInheritanceList: BeforeColon
BreakConstructorInitializers: BeforeComma
AllowAllConstructorInitializersOnNextLine: false

IndentPPDirectives: None
IndentRequires: true
IndentRequires: true
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ jobs:
working-directory: ./build
shell: bash
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_INTERACTIVE=OFF -GNinja
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -GNinja
ninja
- name: Run unit tests
working-directory: ./build/test/unit-tests
shell: bash
run: ./CenturionTests
run: ./testcenturion

- name: Run mocked test suite
working-directory: ./build/test/mocks
shell: bash
run: ./CenturionMocks
run: ./mockcenturion
68 changes: 30 additions & 38 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,32 @@ name: "CI: Ubuntu"
on: [ push, pull_request ]

env:
SDL_LATEST: 2.0.14
IMG_VERSION: 2.0.5
MIX_VERSION: 2.0.4
TTF_VERSION: 2.0.15
SDL_LATEST: 2.0.16
SDL_VIDEODRIVER: x11
DISPLAY: :99.0

jobs:
ubuntu-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
SDL_VERSION: [ 2.0.10, 2.0.12, 2.0.14, 2.0.16 ]
CPP_VERSION: [ 17, 20 ]
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@v3
- uses: lukka/get-cmake@v3.18.3
- uses: actions/checkout@main
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: lukka/get-cmake@latest

- name: Update packages
shell: bash
run: sudo apt-get update
run: sudo apt update

- name: Install graphics drivers
shell: bash
run: |
sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libasound2-dev libpulse-dev
run: sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libasound2-dev libpulse-dev

- name: Install code coverage tools
if: ${{matrix.SDL_VERSION == env.SDL_LATEST && matrix.CPP_VERSION == '20' }}
if: ${{ matrix.SDL_VERSION == env.SDL_LATEST && matrix.CPP_VERSION == '20' }}
shell: bash
run: |
sudo apt-get install -y libjson-perl
Expand All @@ -50,41 +46,39 @@ jobs:
/sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 800x600x24 -ac +extension GLX;
sleep 3
- name: Install SDL2
- name: Cache SDL2
id: cache-sdl2
uses: actions/cache@main
with:
path: SDL2-${{matrix.SDL_VERSION}}
key: SDL2-${{matrix.SDL_VERSION}}

- name: Build SDL2
shell: bash
if: steps.cache-sdl2.outputs.cache-hit != 'true'
run: |
curl -L https://www.libsdl.org/release/SDL2-${{matrix.SDL_VERSION}}.tar.gz | tar xz
cd SDL2-${{matrix.SDL_VERSION}}
./configure
make
sudo make install
- name: Install SDL2_image
- name: Install SDL2
shell: bash
run: |
curl -L https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${{env.IMG_VERSION}}.tar.gz | tar xz
cd SDL2_image-${{env.IMG_VERSION}}
./configure
make
cd SDL2-${{matrix.SDL_VERSION}}
sudo make install
- name: Install SDL2_image
shell: bash
run: sudo apt install libsdl2-image-dev

- name: Install SDL2_mixer
shell: bash
run: |
curl -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-${{env.MIX_VERSION}}.tar.gz | tar xz
cd SDL2_mixer-${{env.MIX_VERSION}}
./configure
make
sudo make install
run: sudo apt install libsdl2-mixer-dev

- name: Install SDL2_ttf
shell: bash
run: |
curl -L https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${{env.TTF_VERSION}}.tar.gz | tar xz
cd SDL2_ttf-${{env.TTF_VERSION}}
./configure
make
sudo make install
run: sudo apt install libsdl2-ttf-dev

- name: Create build directory
shell: bash
Expand All @@ -96,27 +90,25 @@ jobs:
run: |
if [[ "${{matrix.SDL_VERSION}}" == "${{env.SDL_LATEST}}" && "${{matrix.CPP_VERSION}}" == "20" ]];
then
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_AUDIO=OFF -DCEN_COVERAGE=ON -DCEN_INTERACTIVE=OFF -GNinja
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_AUDIO=OFF -DCEN_COVERAGE=ON -DCEN_EXAMPLES=OFF -GNinja
else
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_AUDIO=OFF -DCEN_COVERAGE=OFF -DCEN_INTERACTIVE=OFF -GNinja
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_AUDIO=OFF -DCEN_COVERAGE=OFF -DCEN_EXAMPLES=OFF -GNinja
fi
- name: Build
working-directory: ./build
shell: bash
run: |
ninja CenturionTests
ninja CenturionMocks
run: ninja

- name: Run mocked test suite
working-directory: ./build/test/mocks
shell: bash
run: ./CenturionMocks
run: ./mockcenturion

- name: Run unit tests
working-directory: ./build/test/unit-tests
shell: bash
run: ./CenturionTests
run: ./testcenturion

- name: Capture code coverage
if: ${{matrix.SDL_VERSION == env.SDL_LATEST && matrix.CPP_VERSION == '20' }}
Expand Down
62 changes: 19 additions & 43 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,66 +15,42 @@ jobs:
SDL_VERSION: [ 2.0.10, 2.0.12, 2.0.14, 2.0.16 ]
CPP_VERSION: [ 17, 20 ]
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- uses: seanmiddleditch/gha-setup-ninja@v3
- uses: lukka/get-cmake@v3.18.3
- uses: actions/checkout@main
- uses: ilammy/msvc-dev-cmd@master
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: lukka/get-cmake@latest

- name: Create binaries directory
run: mkdir bin
shell: cmd
run: mkdir bin

- name: Download SDL2
uses: albin-johansson/download-sdl2@v1
uses: albin-johansson/download-sdl2@latest
with:
version: ${{matrix.SDL_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download SDL2_image
uses: albin-johansson/download-sdl2-image@v1
uses: albin-johansson/download-sdl2-image@latest
with:
version: ${{env.IMG_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download SDL2_mixer
uses: suisei-cn/actions-download-file@v1
id: DownloadSDL2_mixer
with:
url: "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-${{env.MIX_VERSION}}-VC.zip"
target: .

- name: Download SDL2_ttf
uses: suisei-cn/actions-download-file@v1
id: DownloadSDL2_ttf
uses: albin-johansson/download-sdl2-ttf@latest
with:
url: "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${{env.TTF_VERSION}}-VC.zip"
target: .

- name: Download SDL2_mixer runtime binaries
uses: suisei-cn/actions-download-file@v1
id: download_sdl2_mixer_runtime_binaries
with:
url: "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-${{env.MIX_VERSION}}-win32-x64.zip"
target: ./bin
version: ${{env.TTF_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download SDL2_ttf runtime binaries
uses: suisei-cn/actions-download-file@v1
id: download_sdl2_ttf_runtime_binaries
- name: Download SDL2_mixer
uses: albin-johansson/download-sdl2-mixer@latest
with:
url: "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${{env.TTF_VERSION}}-win32-x64.zip"
target: ./bin

- name: Unzip archives (sources)
run: |
7z x -y SDL2_mixer-devel-${{env.MIX_VERSION}}-VC.zip
7z x -y SDL2_ttf-devel-${{env.TTF_VERSION}}-VC.zip
- name: Unzip archives (runtime binaries)
run: |
7z e -y ./bin/SDL2_mixer-${{env.MIX_VERSION}}-win32-x64.zip -obin
7z e -y ./bin/SDL2_ttf-${{env.TTF_VERSION}}-win32-x64.zip -obin
version: ${{env.MIX_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Create build folder
run: cmake -E make_directory ./build
Expand All @@ -87,10 +63,10 @@ jobs:
SDL2MIXERDIR: ${{github.workspace}}/SDL2_mixer-${{env.MIX_VERSION}}
SDL2TTFDIR: ${{github.workspace}}/SDL2_ttf-${{env.TTF_VERSION}}
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -DCEN_INTERACTIVE=OFF -GNinja
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{matrix.CPP_VERSION}} -GNinja
ninja
- name: Run mocked test suite
shell: cmd
working-directory: ./build/test/mocks
run: CenturionMocks
shell: cmd
run: mockcenturion
Loading

0 comments on commit becc954

Please sign in to comment.