Standalone build (#9)

* Organizes libultraship files into directories.

* Adds StormLib, ZAPDUTILS, and tidies up /lib/

* Moves include up a directory and moves abi.h to include.

* Fixes gitignore to only ignore build folders, and commits forgotten files.

* update CMakeLists and `#include`s to match directory structure

* Windows CMake now builds project files.

* Restructure CMake project

* feat: sdl via vcpkg (#1)

Co-authored-by: briaguya <briaguya@alice>

* Build via VS generator

* Use ccache for faster building

* Error CI workflow on no lib generated

* Remove unused lib (mINI)

* Update embedded lib (nlohmann-json)

* Cleanup main CMakeLists.txt

* Remove unecessary header

* Use Ninja for MSVC

* Update embedded lib (spdlog)

* Update embedded lib (StormLib)

* Improve CMake structure

* define NOMINMAX for certain windows files

* Add and run clang-format

* Add and run clang-tidy

* Add CI workflow for clang-format/tidy

* Split CI workflows

* Use new format validation

* Fixes typos preventing patch OTRs from working on Switch (#8)

* Removes third party BinaryTools and re-implements and reloacates ZAPDUtils Binary Tools. (#7)

* Removes third party BinaryTools and implements ZAPDUtils' into LUS.

* Attempts to make the Linter happy.

* Another run of linter fixing improvements.

* Should be last linting-related change.

* Fixes tidy-format-validation to only check src and include directories in the git diff

Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: David Chavez <david@dcvz.io>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
Kenix3
2022-11-03 18:26:17 -04:00
committed by Kenix
co-authored by briaguya David Chavez briaguya Christopher Leggett
parent 6d7112168e
commit 2aecab6840
2253 changed files with 304950 additions and 58534 deletions
+90
View File
@@ -0,0 +1,90 @@
name: build-validation
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-macos:
runs-on: macos-12
steps:
- name: Install dependencies
run: |
brew install sdl2 libpng glew ninja
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache
- name: Build libultraship
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build build-cmake --config Release --parallel 10
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: soh-mac
path: build-cmake/src/*.a
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libpng-dev libglew-dev ninja-build
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz
tar -xzf SDL2-2.24.1.tar.gz
cd SDL2-2.24.1
./configure
make -j 10
sudo make install
- name: Build libultraship
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build build-cmake --config Release --parallel 10
env:
CC: gcc-10
CXX: g++-10
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: soh-linux
path: build-cmake/src/*.a
if-no-files-found: error
build-windows:
runs-on: windows-latest
steps:
- name: Install dependencies
run: |
choco install ninja
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force
- uses: actions/checkout@v2
- name: ccache
uses: dcvz/ccache-action@27b9f33213c0079872f064f6b6ba0233dfa16ba2
with:
key: ${{ runner.os }}-ccache
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build libultraship
run: |
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
cmake --no-warn-unused-cli -S. -Bbuild-cmake -GNinja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DUSE_AUTO_VCPKG=ON -DCMAKE_VS_PLATFORM_NAME=x64
cmake --build build-cmake --config Release --parallel 10
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: soh-windows
path: build-cmake/**/src/**/*.lib
if-no-files-found: error
@@ -0,0 +1,56 @@
name: tidy-format-validation
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tidy-format:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libpng-dev libglew-dev ninja-build clang-tidy clang-format-12
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache
- name: Run clang-format
run: |
clang-format-12 -i -style=file src/**/*.cpp src/**/*.h include/*.h
git diff --exit-code
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz
tar -xzf SDL2-2.24.1.tar.gz
cd SDL2-2.24.1
./configure
make -j 10
sudo make install
- name: Prepare compile_commands.json
run: |
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
git diff -U0 HEAD^ -- 'src' 'include' | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml
- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@master
with:
# The GitHub token (or a personal access token)
github_token: ${{ secrets.GITHUB_TOKEN }}
# The path to the clang-tidy fixes generated previously
clang_tidy_fixes: clang-tidy-result/fixes.yml
# Optionally set to true if you want the Action to request
# changes in case warnings are found
request_changes: true
# Optionally set the number of comments per review
# to avoid GitHub API timeouts for heavily loaded
# pull requests
suggestions_per_comment: 10