Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3b99ff0
Reworked build process to use package manager
Hugo-RM Aug 29, 2025
84708c2
Added the SHA to the build.yml file
Hugo-RM Aug 29, 2025
9b9071b
Added vcpkg.json to see if that fixes issue
Hugo-RM Aug 29, 2025
36e3ccb
Fixing vckpg.json file
Hugo-RM Aug 29, 2025
aa884ff
Added argument to test meowstro without input
Hugo-RM Aug 29, 2025
39bc467
Added argument to test meowstro without input
Hugo-RM Aug 29, 2025
e602f1e
Merge branch 'meowstro_v2' of https://github.com/Hugo-RM/meowstro int…
Hugo-RM Aug 29, 2025
29d9213
Merge branch 'meowstro_v2' of https://github.com/Hugo-RM/meowstro int…
Hugo-RM Aug 29, 2025
28e5c0c
Merge branch 'meowstro_v2' of https://github.com/Hugo-RM/meowstro int…
Hugo-RM Aug 29, 2025
dee0528
updated build to have a bit more efficiency hopefully
Hugo-RM Aug 29, 2025
dbb9756
Added refreshenvs
Hugo-RM Aug 29, 2025
bcb1ab5
I think I fixed the bugs
Hugo-RM Aug 29, 2025
a677757
Simplified test to avoid SDL_Mixer not finding audio endpoint
Hugo-RM Aug 29, 2025
50f601f
Tried to fix caching and cppcheck
Hugo-RM Aug 30, 2025
f8d96a1
Tried making it work also updated build scripts
Hugo-RM Aug 30, 2025
1e92fbd
Tried fixing cppcheck path refresh issue
Hugo-RM Aug 30, 2025
8101ab4
Linux and Mac fixes since Windows works now
Hugo-RM Aug 30, 2025
6cef821
I hope this fixes Windows and Linux ;-;
Hugo-RM Aug 30, 2025
f07f29f
Fixed Windows build problems I hope
Hugo-RM Aug 30, 2025
b03f485
Trying to fix MacOS by changing output dir
Hugo-RM Aug 30, 2025
544737a
Simplified set up and added version documentation
Hugo-RM Aug 30, 2025
43ae8f4
updated versions because linux needs older version
Hugo-RM Aug 30, 2025
7b5d428
Updated Versions again
Hugo-RM Aug 30, 2025
0577217
Updated Versions again
Hugo-RM Aug 30, 2025
8ef696c
trying to fix caching
Hugo-RM Aug 30, 2025
6a00c1f
Removed ignore flags for windows build
Hugo-RM Aug 31, 2025
64d962f
I believe I fixed the memory leaks from SDL_Texture
Hugo-RM Aug 31, 2025
9ae096f
Created ResourceManager class, Improved efficiency
Hugo-RM Aug 31, 2025
56f4ff4
Removed Unused Assets
Hugo-RM Aug 31, 2025
f14fb9f
removed namespace std, created GameConfig class
Hugo-RM Aug 31, 2025
2a52b56
Commented out couts and made colors constants
Hugo-RM Aug 31, 2025
493be72
Created InputHandler class
Hugo-RM Aug 31, 2025
44a1241
Added GameStateManager to handle state management
Hugo-RM Aug 31, 2025
d1ac439
Moved game loop logic out of meowstro.cpp file
Hugo-RM Sep 1, 2025
f0f19a8
Fixed hook animation issue
Hugo-RM Sep 1, 2025
0de19b6
Removed large gameLoop function from main file
Hugo-RM Sep 1, 2025
044072a
Created Menu Class
Hugo-RM Sep 1, 2025
189372a
Created AnimationSystem class
Hugo-RM Sep 1, 2025
acc4c49
Using Logger and consistent error handling
Hugo-RM Sep 1, 2025
03541d2
Fixed possible memory leak and replaced couts with log
Hugo-RM Sep 2, 2025
5e55828
Added testing. Time to test it
Hugo-RM Sep 2, 2025
11b5a13
Made a good number of changes to tests/workflow
Hugo-RM Sep 3, 2025
5273e08
Tests added for GameStats class
Hugo-RM Sep 3, 2025
6255458
Tests added for Logger class
Hugo-RM Sep 3, 2025
8838d0a
Added Tests for a good amount of classes w gtest
Hugo-RM Sep 4, 2025
8014bed
Possibly faulty commit. Moving changes from laptop to pc
Hugo-RM Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 200 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,233 @@
name: Windows Build and Test
name: Multi-Platform Build and Test

on:
push:
branches:
- main
- '**'
pull_request:

jobs:
build:
build-windows:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set Up Python
uses: actions/setup-python@v4
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
python-version: "3.x"
vcpkgGitCommitId: '5300a2a461a53b76405db4fcbe6aeb0eea43935d'

- name: Install SDL2
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
path: |
build/vcpkg_installed
${{ env.VCPKG_ROOT }}/installed
${{ env.VCPKG_ROOT }}/packages
${{ env.VCPKG_ROOT }}/buildtrees
${{ env.VCPKG_ROOT }}/downloads
key: vcpkg-windows-${{ hashFiles('vcpkg.json') }}-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
vcpkg-windows-${{ hashFiles('vcpkg.json') }}-
vcpkg-windows-

- name: Run cppcheck (static analysis - fail fast)
run: |
if (!(Get-Command cppcheck -ErrorAction SilentlyContinue)) {
choco install cppcheck -y
}
$cppcheck = if (Get-Command cppcheck -ErrorAction SilentlyContinue) { "cppcheck" } else { "C:\Program Files\Cppcheck\cppcheck.exe" }
& $cppcheck --enable=all --inconclusive --std=c++17 --quiet `
-I include `
-I "${{ env.VCPKG_ROOT }}/installed/x64-windows/include" `
src

- name: Cache CMake build directory
uses: actions/cache@v4
with:
path: build
key: cmake-windows-${{ hashFiles('**/CMakeLists.txt', 'vcpkg.json') }}-${{ hashFiles('src/**', 'include/**') }}
restore-keys: |
cmake-windows-${{ hashFiles('**/CMakeLists.txt', 'vcpkg.json') }}-
cmake-windows-

- name: Prepare build.ps1 from build.default.ps1
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL/releases/download/release-2.32.2/SDL2-devel-2.32.2-VC.zip -OutFile SDL2.zip
Expand-Archive -Path SDL2.zip -DestinationPath C:\SDL2_tmp
Move-Item -Path C:\SDL2_tmp\SDL2-2.32.2\* -Destination C:\SDL2 -Force
if (Test-Path "C:\SDL2\include\SDL.h") { echo "✅ Extraction Successful: SDL.h found" } else { echo "❌ Extraction Failed: SDL.h missing"; exit 1 }
Copy-Item build.default.ps1 build.ps1
(Get-Content build.ps1) -replace '^\$VCPKG_PATH\s*=.*', '$VCPKG_PATH = "${{ env.VCPKG_ROOT }}"' | Set-Content build.ps1

- name: Install SDL2_image
- name: Configure CMake for clang-tidy
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.8/SDL2_image-devel-2.8.8-VC.zip -OutFile SDL2_image.zip
Expand-Archive -Path SDL2_image.zip -DestinationPath C:\SDL2_image_tmp
Move-Item -Path C:\SDL2_image_tmp\SDL2_image-2.8.8\* -Destination C:\SDL2_image -Force
if (Test-Path "C:\SDL2_image\include\SDL_image.h") { echo "✅ Extraction Successful: SDL_image.h found" } else { echo "❌ Extraction Failed: SDL_image.h missing"; exit 1 }
# Configure CMake to generate compile_commands.json for clang-tidy
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug

- name: Install SDL2_mixer
- name: Run clang-tidy (static analysis after CMake configure)
run: |
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.1/SDL2_mixer-devel-2.8.1-VC.zip -OutFile SDL2_mixer.zip
Expand-Archive -Path SDL2_mixer.zip -DestinationPath C:\SDL2_mixer_tmp
Move-Item -Path C:\SDL2_mixer_tmp\SDL2_mixer-2.8.1\* -Destination C:\SDL2_mixer -Force
if (Test-Path "C:\SDL2_mixer\include\SDL_mixer.h") { echo "✅ Extraction Successful: SDL_mixer.h found" } else { echo "❌ Extraction Failed: SDL_mixer.h missing"; exit 1 }
if (!(Get-Command clang-tidy -ErrorAction SilentlyContinue)) {
choco install llvm -y
}
if (Test-Path "build/compile_commands.json") {
clang-tidy -p build $(Get-ChildItem -Path src -Filter *.cpp | ForEach-Object { $_.FullName })
} else {
Write-Host "No compilation database found, skipping clang-tidy"
}

- name: Build and Test via Script
shell: pwsh
run: |
# Run the test script which handles build, test execution, and CTest
./test.ps1

- name: Upload Executable Artifact (main branch only)
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: meowstro-windows
path: build/bin/Debug/

- name: Install SDL2_ttf
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Cache APT packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
apt-${{ runner.os }}-

- name: Install SDL2 system packages and build tools
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libgtest-dev \
googletest \
cppcheck \
clang-tidy

- name: Run cppcheck (static analysis - fail fast)
run: |
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-devel-2.24.0-VC.zip -OutFile SDL2_ttf.zip
Expand-Archive -Path SDL2_ttf.zip -DestinationPath C:\SDL2_ttf_tmp
Move-Item -Path C:\SDL2_ttf_tmp\SDL2_ttf-2.24.0\* -Destination C:\SDL2_ttf -Force
if (Test-Path "C:\SDL2_ttf\include\SDL_ttf.h") { echo "✅ Extraction Successful: SDL_ttf.h found" } else { echo "❌ Extraction Failed: SDL_ttf.h missing"; exit 1 }
cppcheck --enable=all --inconclusive --std=c++17 --quiet \
-I include \
src

- name: Create config.json from Default
- name: Cache CMake build directory
uses: actions/cache@v4
with:
path: build
key: cmake-linux-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('src/**', 'include/**') }}
restore-keys: |
cmake-linux-${{ hashFiles('**/CMakeLists.txt') }}-
cmake-linux-

- name: Configure CMake (using system packages, NOT vcpkg)
run: |
copy config.default.json config.json
python -c "import json; f=open('config.json', 'r+'); d=json.load(f); \
d.update({'SDL2_DIR': 'C:/SDL2', 'SDL2_IMAGE_DIR': 'C:/SDL2_image', 'SDL2_MIXER_DIR': 'C:/SDL2_mixer', 'SDL2_TTF_DIR': 'C:/SDL2_ttf'}); \
f.seek(0); json.dump(d, f, indent=4); f.truncate(); f.close()"
# Explicitly avoid vcpkg by not setting CMAKE_TOOLCHAIN_FILE
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

# - name: Debug Config JSON
# run: type config.json
- name: Run clang-tidy (static analysis after CMake configure)
run: |
if [ -f "build/compile_commands.json" ]; then
find src -name '*.cpp' -exec clang-tidy -p build {} \;
else
echo "No compilation database found, skipping clang-tidy"
fi

- name: Generate CMakePresets.json
run: python generate_cmake_presets.py
- name: Build and Test via Script
run: |
# Make script executable and run it
chmod +x ./test.sh
./test.sh

# - name: Debug CMakePresets.json
# run: type CMakePresets.json
- name: Upload Executable Artifact (main branch only)
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: meowstro-linux
path: build/bin/Debug/

- name: Configure CMake
run: cmake --preset my-build
build-macos:
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

# - name: Debug CMake Cache Variables
# run: cmake --preset my-build --debug-output
- name: Cache Homebrew packages
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew
/opt/homebrew/var/homebrew/locks
key: brew-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
brew-${{ runner.os }}-

- name: Install SDL2 via Homebrew
run: |
brew install \
sdl2 \
sdl2_image \
sdl2_mixer \
sdl2_ttf \
googletest \
cppcheck \
llvm

- name: Run cppcheck (static analysis - fail fast)
run: |
cppcheck --enable=all --inconclusive --std=c++17 --quiet \
-I include \
src

- name: Cache CMake build directory
uses: actions/cache@v4
with:
path: build
key: cmake-macos-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('src/**', 'include/**') }}
restore-keys: |
cmake-macos-${{ hashFiles('**/CMakeLists.txt') }}-
cmake-macos-

- name: Build Project
- name: Configure CMake (Homebrew packages)
run: |
cd "./build"
cmake --build .
HOMEBREW_PREFIX=$(brew --prefix)
cmake -B build -S . \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="$HOMEBREW_PREFIX"

- name: Copy DLLs to Executable Directory
- name: Run clang-tidy (static analysis after CMake configure)
run: |
copy C:\SDL2\lib\x64\SDL2.dll build/bin/Debug/
copy C:\SDL2_image\lib\x64\SDL2_image.dll build/bin/Debug/
copy C:\SDL2_mixer\lib\x64\SDL2_mixer.dll build/bin/Debug/
copy C:\SDL2_ttf\lib\x64\SDL2_ttf.dll build/bin/Debug/
if [ -f "build/compile_commands.json" ]; then
$(brew --prefix llvm)/bin/clang-tidy -p build $(find src -name '*.cpp')
else
echo "No compilation database found, skipping clang-tidy"
fi

- name: Run Executable (Optional)
working-directory: build/bin/Debug
- name: Build and Test via Script
run: |
./meowstro.exe
# Make script executable and run it
chmod +x ./test.sh
./test.sh

- name: Upload Executable Artifact (main branch only)
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: meowstro-macos
path: build/bin/Debug/
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ build/
.vscode/

# Ignore configuration files that contain user-specific paths
config.json
build.ps1
build.bat
build.sh
CMakePresets.json
config.json

# Ignore log files and system files
*.log
*.tmp
*.swp
/.vs
.vs/

# Ignore vcpkg installation directory if local
vcpkg_installed/

# Ignore compile commands database (it gets copied to root)
compile_commands.json
Loading
Loading