Fixed critical ResourceManager asset loading issue #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Multi-Platform Build and Test | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: '5300a2a461a53b76405db4fcbe6aeb0eea43935d' | |
| - 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: | | |
| 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: Configure CMake for clang-tidy | |
| shell: pwsh | |
| run: | | |
| # 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: Run clang-tidy (static analysis after CMake configure) | |
| run: | | |
| 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 (Debug) | |
| shell: pwsh | |
| run: | | |
| # Run the test script which handles build, test execution, and CTest | |
| ./test.ps1 | |
| - name: Build and Test (Release) | |
| shell: pwsh | |
| run: | | |
| # Test Release build as well | |
| cmake --build build --config Release | |
| ./build/bin/Release/meowstro_tests.exe | |
| - 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/ | |
| 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: | | |
| 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-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: | | |
| # Explicitly avoid vcpkg by not setting CMAKE_TOOLCHAIN_FILE | |
| cmake -B build -S . \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| - 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: Build and Test (Debug) | |
| run: | | |
| # Make script executable and run it | |
| chmod +x ./test.sh | |
| ./test.sh | |
| - name: Build and Test (Release) | |
| run: | | |
| # Test Release build as well | |
| cmake --build build --config Release | |
| ./build/bin/meowstro_tests | |
| - 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/ | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - 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: Configure CMake (Homebrew packages) | |
| run: | | |
| HOMEBREW_PREFIX=$(brew --prefix) | |
| cmake -B build -S . \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_PREFIX_PATH="$HOMEBREW_PREFIX" | |
| - name: Run clang-tidy (static analysis after CMake configure) | |
| run: | | |
| 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: Build and Test (Debug) | |
| run: | | |
| # Make script executable and run it | |
| chmod +x ./test.sh | |
| ./test.sh | |
| - name: Build and Test (Release) | |
| run: | | |
| # Test Release build as well | |
| cmake --build build --config Release | |
| ./build/bin/meowstro_tests | |
| - 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/ |