From 3216eb4df52bdd07b07e557f6b299d4923f54ede Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 23:54:55 +0000 Subject: [PATCH 1/8] Initial plan From 2746c376f8da258236d2cb888dce6d049a92c0c3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 23:56:38 +0000 Subject: [PATCH 2/8] Add comprehensive CI workflow with multi-platform builds and tests Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com> --- .github/workflows/ci.yml | 370 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..950e661 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,370 @@ +name: Comprehensive CI + +on: + push: + branches: + - master + - release + - devel + pull_request: + branches: + - master + - release + - devel + workflow_dispatch: + +jobs: + # Linux x64 - GCC + linux-gcc-x64: + runs-on: ubuntu-latest + name: Linux x64 (GCC) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + g++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + g++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # Linux x64 - Clang + linux-clang-x64: + runs-on: ubuntu-latest + name: Linux x64 (Clang) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + clang++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + clang++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # Linux ARM64 - GCC (native) + linux-arm64: + runs-on: ubuntu-24.04-arm + name: Linux ARM64 (GCC) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + g++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + g++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # macOS x64 Intel + macos-intel-x64: + runs-on: macos-13 + name: macOS x64 Intel (Clang) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + clang++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + clang++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # macOS ARM64 Apple Silicon + macos-arm64: + runs-on: macos-14 + name: macOS ARM64 Apple Silicon (Clang) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + clang++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + clang++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # Windows x64 - MSVC + windows-msvc-x64: + runs-on: windows-latest + name: Windows x64 (MSVC) + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure + run: | + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -A x64 -DTINYGLTF_BUILD_LOADER_EXAMPLE=On -DTINYGLTF_BUILD_GL_EXAMPLES=Off -DTINYGLTF_BUILD_VALIDATOR_EXAMPLE=Off .. + + - name: Build + run: cmake --build build --config Release + + - name: Run loader_example + run: | + .\build\Release\loader_example.exe models\Cube\Cube.gltf + + - name: Build unit tests + run: | + cd tests + cl /std:c++14 /I.. /EHsc /Fe:tester.exe tester.cc + shell: cmd + + - name: Run unit tests + run: | + cd tests + .\tester.exe + + # Windows x86 - MSVC (build only) + windows-msvc-x86: + runs-on: windows-latest + name: Windows x86 (MSVC) - Build Only + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure + run: | + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -A Win32 -DTINYGLTF_BUILD_LOADER_EXAMPLE=On -DTINYGLTF_BUILD_GL_EXAMPLES=Off -DTINYGLTF_BUILD_VALIDATOR_EXAMPLE=Off .. + + - name: Build + run: cmake --build build --config Release + + # Windows ARM64 - MSVC (cross-compile) + windows-msvc-arm64: + runs-on: windows-latest + name: Windows ARM64 (MSVC) - Cross-compile + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure + run: | + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -A ARM64 -DTINYGLTF_BUILD_LOADER_EXAMPLE=On -DTINYGLTF_BUILD_GL_EXAMPLES=Off -DTINYGLTF_BUILD_VALIDATOR_EXAMPLE=Off .. + + - name: Build + run: cmake --build build --config Release + + # Windows MinGW - MSYS2 + windows-mingw-msys2: + runs-on: windows-latest + name: Windows x64 (MinGW MSYS2) + defaults: + run: + shell: msys2 {0} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: UCRT64 + install: base-devel + pacboy: >- + cc:p cmake:p ninja:p + update: true + release: false + + - name: Build with CMake + run: | + cmake -G"Ninja" -S . -B build + cmake --build build + + - name: Build loader_example directly + run: | + g++ -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + g++ -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # Linux -> Windows MinGW Cross-compile + linux-mingw-cross: + runs-on: ubuntu-latest + name: Linux→Windows (MinGW Cross) - Build Only + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install MinGW + run: | + sudo apt-get update + sudo apt-get install -y build-essential mingw-w64 + + - name: Build + run: | + x86_64-w64-mingw32-g++ -std=c++11 -o loader_example.exe loader_example.cc + + # Special Configuration: No Exceptions + linux-noexception: + runs-on: ubuntu-latest + name: Linux x64 (GCC) - No Exceptions + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example + run: | + g++ -DTINYGLTF_NOEXCEPTION -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + g++ -DTINYGLTF_NOEXCEPTION -I../ -std=c++11 -g -O0 -o tester_noexcept tester.cc + ./tester_noexcept + + # Special Configuration: Header-Only Mode + linux-header-only: + runs-on: ubuntu-latest + name: Linux x64 (GCC) - Header-Only Mode + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build with CMake Header-Only + run: | + mkdir build + cmake -B build -DTINYGLTF_HEADER_ONLY=ON -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON + cmake --build build + + - name: Run loader_example + run: | + ./build/loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests (header-only) + run: | + cd tests + g++ -DTINYGLTF_HEADER_ONLY -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + # Special Configuration: RapidJSON Backend + linux-rapidjson: + runs-on: ubuntu-latest + name: Linux x64 (GCC) - RapidJSON Backend + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Clone RapidJSON + run: | + git clone https://github.com/Tencent/rapidjson + + - name: Build loader_example + run: | + g++ -DTINYGLTF_USE_RAPIDJSON -I./rapidjson/include/rapidjson -std=c++11 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests + run: | + cd tests + g++ -DTINYGLTF_USE_RAPIDJSON -I../rapidjson/include/rapidjson -I../ -std=c++11 -g -O0 -o tester tester.cc + ./tester + + - name: Build and run no-exception tests with RapidJSON + run: | + cd tests + g++ -DTINYGLTF_USE_RAPIDJSON -I../rapidjson/include/rapidjson -DTINYGLTF_NOEXCEPTION -I../ -std=c++11 -g -O0 -o tester_noexcept tester.cc + ./tester_noexcept + + # Special Configuration: AddressSanitizer + linux-asan: + runs-on: ubuntu-latest + name: Linux x64 (Clang) - AddressSanitizer + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example with ASan + run: | + clang++ -fsanitize=address -std=c++11 -g -O1 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests with ASan + run: | + cd tests + clang++ -fsanitize=address -I../ -std=c++11 -g -O1 -o tester tester.cc + ./tester + + # Special Configuration: UndefinedBehaviorSanitizer + linux-ubsan: + runs-on: ubuntu-latest + name: Linux x64 (Clang) - UndefinedBehaviorSanitizer + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build loader_example with UBSan + run: | + clang++ -fsanitize=undefined -std=c++11 -g -O1 -o loader_example loader_example.cc + + - name: Run loader_example + run: | + ./loader_example models/Cube/Cube.gltf + + - name: Build and run unit tests with UBSan + run: | + cd tests + clang++ -fsanitize=undefined -I../ -std=c++11 -g -O1 -o tester tester.cc + ./tester From f5dcdf2e9a06df81e708d340d84e95036b9b394d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 23:59:18 +0000 Subject: [PATCH 3/8] Add security: restrict GITHUB_TOKEN permissions to read-only Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com> --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 950e661..69e914c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,9 @@ on: - devel workflow_dispatch: +permissions: + contents: read + jobs: # Linux x64 - GCC linux-gcc-x64: From 604411c80a37b9d57de5d9bb605ad75c4e6abbc6 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 5 Feb 2026 04:08:50 +0900 Subject: [PATCH 4/8] Fix Windows MSVC unit tests build by setting up developer environment The `cl` compiler was not in PATH because the Visual Studio developer environment needs to be set up before calling MSVC tools directly. Added `ilammy/msvc-dev-cmd@v1` action to configure the environment. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69e914c..bfe3c6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,6 +148,9 @@ jobs: run: | .\build\Release\loader_example.exe models\Cube\Cube.gltf + - name: Setup MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + - name: Build unit tests run: | cd tests From 80e94aeec8200e462f2e69a447f5605be366b8d6 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 5 Feb 2026 04:31:09 +0900 Subject: [PATCH 5/8] Fix CI: update macOS runner and remove Windows unit tests - Change macos-13 to macos-15-large for Intel x64 (macos-13 is retired) - Remove Windows MSVC unit tests (they have path-related issues and the existing c-cpp.yml workflow doesn't run tests on Windows either) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfe3c6e..f89a213 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: # macOS x64 Intel macos-intel-x64: - runs-on: macos-13 + runs-on: macos-15-large name: macOS x64 Intel (Clang) steps: - name: Checkout @@ -148,20 +148,6 @@ jobs: run: | .\build\Release\loader_example.exe models\Cube\Cube.gltf - - name: Setup MSVC environment - uses: ilammy/msvc-dev-cmd@v1 - - - name: Build unit tests - run: | - cd tests - cl /std:c++14 /I.. /EHsc /Fe:tester.exe tester.cc - shell: cmd - - - name: Run unit tests - run: | - cd tests - .\tester.exe - # Windows x86 - MSVC (build only) windows-msvc-x86: runs-on: windows-latest From a3618c945b639df13f869de0ee45c7239dac1d29 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 5 Feb 2026 05:08:09 +0900 Subject: [PATCH 6/8] Remove macOS Intel job from CI macOS Intel runners are being deprecated. Keep only the ARM64 Apple Silicon job for macOS coverage. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f89a213..0eb42cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,28 +83,6 @@ jobs: g++ -I../ -std=c++11 -g -O0 -o tester tester.cc ./tester - # macOS x64 Intel - macos-intel-x64: - runs-on: macos-15-large - name: macOS x64 Intel (Clang) - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build loader_example - run: | - clang++ -std=c++11 -o loader_example loader_example.cc - - - name: Run loader_example - run: | - ./loader_example models/Cube/Cube.gltf - - - name: Build and run unit tests - run: | - cd tests - clang++ -I../ -std=c++11 -g -O0 -o tester tester.cc - ./tester - # macOS ARM64 Apple Silicon macos-arm64: runs-on: macos-14 From 47717e469c6a4f080aa408ce2062ab8b4abc3c6c Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 5 Feb 2026 05:19:22 +0900 Subject: [PATCH 7/8] Add ctest to CMake-based builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run ctest after build for: - Windows x64 MSVC - Windows x86 MSVC - Windows MinGW MSYS2 - Linux Header-Only Mode Cross-compile builds (Windows ARM64, Linux→Windows MinGW) are excluded since tests cannot run on the host. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0eb42cb..40d391b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,10 +126,13 @@ jobs: run: | .\build\Release\loader_example.exe models\Cube\Cube.gltf - # Windows x86 - MSVC (build only) + - name: Run tests + run: ctest --test-dir build -C Release --output-on-failure + + # Windows x86 - MSVC windows-msvc-x86: runs-on: windows-latest - name: Windows x86 (MSVC) - Build Only + name: Windows x86 (MSVC) steps: - name: Checkout uses: actions/checkout@v4 @@ -143,6 +146,9 @@ jobs: - name: Build run: cmake --build build --config Release + - name: Run tests + run: ctest --test-dir build -C Release --output-on-failure + # Windows ARM64 - MSVC (cross-compile) windows-msvc-arm64: runs-on: windows-latest @@ -186,19 +192,12 @@ jobs: cmake -G"Ninja" -S . -B build cmake --build build - - name: Build loader_example directly - run: | - g++ -std=c++11 -o loader_example loader_example.cc - - name: Run loader_example run: | - ./loader_example models/Cube/Cube.gltf + ./build/loader_example models/Cube/Cube.gltf - - name: Build and run unit tests - run: | - cd tests - g++ -I../ -std=c++11 -g -O0 -o tester tester.cc - ./tester + - name: Run tests + run: ctest --test-dir build --output-on-failure # Linux -> Windows MinGW Cross-compile linux-mingw-cross: @@ -257,11 +256,8 @@ jobs: run: | ./build/loader_example models/Cube/Cube.gltf - - name: Build and run unit tests (header-only) - run: | - cd tests - g++ -DTINYGLTF_HEADER_ONLY -I../ -std=c++11 -g -O0 -o tester tester.cc - ./tester + - name: Run tests + run: ctest --test-dir build --output-on-failure # Special Configuration: RapidJSON Backend linux-rapidjson: From 57b1c99db25c8607ade65b250e22d128606c5140 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 5 Feb 2026 05:35:46 +0900 Subject: [PATCH 8/8] Use CMake and ctest for RapidJSON backend build Convert RapidJSON backend job from manual g++ builds to CMake, enabling ctest for running tests. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40d391b..c3484cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -271,25 +271,19 @@ jobs: run: | git clone https://github.com/Tencent/rapidjson - - name: Build loader_example + - name: Configure run: | - g++ -DTINYGLTF_USE_RAPIDJSON -I./rapidjson/include/rapidjson -std=c++11 -o loader_example loader_example.cc + cmake -B build -DTINYGLTF_USE_RAPIDJSON=ON -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON -DCMAKE_PREFIX_PATH=$PWD/rapidjson + + - name: Build + run: cmake --build build - name: Run loader_example run: | - ./loader_example models/Cube/Cube.gltf + ./build/loader_example models/Cube/Cube.gltf - - name: Build and run unit tests - run: | - cd tests - g++ -DTINYGLTF_USE_RAPIDJSON -I../rapidjson/include/rapidjson -I../ -std=c++11 -g -O0 -o tester tester.cc - ./tester - - - name: Build and run no-exception tests with RapidJSON - run: | - cd tests - g++ -DTINYGLTF_USE_RAPIDJSON -I../rapidjson/include/rapidjson -DTINYGLTF_NOEXCEPTION -I../ -std=c++11 -g -O0 -o tester_noexcept tester.cc - ./tester_noexcept + - name: Run tests + run: ctest --test-dir build --output-on-failure # Special Configuration: AddressSanitizer linux-asan: