34 Commits

Author SHA1 Message Date
Syoyo Fujita
a4b5752b1b fix build and remove unused workflows. 2026-06-02 19:16:37 +09:00
Syoyo Fujita
381daedaba Run v3 C tests with CMake and Meson 2026-06-01 18:31:49 +09:00
Syoyo Fujita
d31c16e333 CI: fix clang -Werror on unknown flag and MSVC fopen warning
run 25611531122 surfaced two failures:

- Stock Ubuntu clang errored on `-Wno-pre-c11-compat` (added in newer
  clang). Add `-Wno-unknown-warning-option` so older clang silently
  ignores warning flags it doesn't know.

- MSVC /W4 /WX failed on C4996 (fopen deprecation). Define
  `_CRT_SECURE_NO_WARNINGS` for the v3 C MSVC build; the parser uses
  fopen by design and v1 already takes the same approach.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 06:00:09 +09:00
Syoyo Fujita
36c9643981 CI: bump GitHub Actions to Node.js 24 versions
Silence the deprecation warnings reported on
https://github.com/syoyo/tinygltf/actions/runs/25610558215 by upgrading
all `actions/checkout` usages from v1/v2/v3/v4 to v5 (Node 24 runtime)
and the CodeQL actions from v2 to v3.

msys2/setup-msys2 stays at v2 — it's the latest tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 05:34:39 +09:00
Syoyo Fujita
c9b3b9c644 Build v3 C under clang -Weverything and MSVC /W4
Escalate v3 C warning levels in CI to catch latent issues:
gcc/clang now run with -Werror, clang adds -Weverything (with a
small irreducible suppression list for -Wpadded, -Wunsafe-buffer-usage,
-Wcast-align, etc.), and a new MSVC job builds tester_v3_c with /W4 /WX.

Source fixes to clear the elevated warnings:
- tg3__arena_new_block: cast through void* to silence -Wcast-align.
- tg3__value_to_json: handle TG3_VALUE_BINARY explicitly and drop the
  default label so -Wswitch-enum and -Wcovered-switch-default agree.
- Drop unused tg3__json_set_value_copy.
- tinygltf_json_c.h: enumerate all tg3json_value_type cases in
  tg3json_value_free / tg3json_value_copy / tg3json__stringify_value_ex.
- tester_v3_c_v1port FAIL macro: split the format/newline prints so it
  no longer relies on the GNU `, ##__VA_ARGS__` extension.

Verified: clang -Werror -Weverything builds clean, 13/13 internal
tests, 18/18 v1-port tests, and 134/134 cross-version regression all
pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 04:33:21 +09:00
Syoyo Fujita
d20c9298e5 Build v3 C tests under clang too; drop GNU VA_ARGS extension
ci.yml now runs the v3 C suites under three Linux toolchains:
- v3-c-tests        (default cc / GCC, -Wall -Wextra)
- v3-c-tests-clang  (stock Ubuntu clang)
- v3-c-tests-clang21 (clang 21 from apt.llvm.org, matching local dev)

The validator helper macros TG3__IDX_BAD / TG3__CHECK_REQ /
TG3__CHECK_OPT used the GNU `, ##__VA_ARGS__` extension, which clang
flags under -Wpedantic. Every call site already passes at least one
variadic argument, so plain __VA_ARGS__ (C11) suffices.

Local verification: clang-21 -Wall -Wextra builds tester_v3_c and
tester_v3_c_v1port with zero warnings introduced by the v3 changes
(only the pre-existing tg3__json_set_value_copy unused-function
notice remains, unrelated to this work). All suites pass under gcc
13.3 and clang 21.1 alike, plus the 134-model cross-version
verifier.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 04:04:15 +09:00
Syoyo Fujita
70a6a0c0ea Run v3 C tests in GitHub CI
ci.yml: two new jobs.
  - v3-c-tests builds tester_v3_c (security regressions) and
    tester_v3_c_v1port (18 ported v1 unit tests) with the default
    system cc (gcc on ubuntu-latest) and runs both.
  - v3-c-tests-sanitizers rebuilds the same suites under clang with
    -fsanitize=address,undefined and ASAN_OPTIONS=halt_on_error=1 plus
    leak detection so memory-safety regressions break CI.

c-cpp.yml: add a v3_c_tests step to build-linux so the legacy gcc
workflow also exercises the v3 C parser end-to-end.

Both invoke the parser via parse_auto with TINYGLTF3_ENABLE_FS so the
external-file paths (and the new path-traversal/file-size guards)
are exercised end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 03:56:13 +09:00
Syoyo Fujita
797bf0e023 Use CMake and ctest for Linux and macOS native builds
Convert manual g++/clang++ builds to CMake for consistency with
Windows builds:
- Linux x64 (GCC)
- Linux ARM64 (GCC)
- macOS ARM64 Apple Silicon (Clang)

All native builds now use:
- cmake -B build -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON
- cmake --build build
- ctest --test-dir build --output-on-failure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 00:52:59 +09:00
Syoyo Fujita
10ac914244 Update Linux Clang job to use Clang 21
- Install Clang 21 from LLVM apt repository
- Use CMake with clang-21/clang++-21 compilers
- Run tests with ctest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 00:24:55 +09:00
Syoyo Fujita
b548191e41 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 <noreply@anthropic.com>
2026-02-05 05:35:46 +09:00
Syoyo Fujita
17287c7fcf Add ctest to CMake-based builds
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 <noreply@anthropic.com>
2026-02-05 05:19:22 +09:00
Syoyo Fujita
6c948d5bc3 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 <noreply@anthropic.com>
2026-02-05 05:08:09 +09:00
Syoyo Fujita
d4a4a1b27a 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 <noreply@anthropic.com>
2026-02-05 04:54:40 +09:00
Syoyo Fujita
3d5453ecd0 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 <noreply@anthropic.com>
2026-02-05 04:54:40 +09:00
copilot-swe-agent[bot]
52a453120b Add security: restrict GITHUB_TOKEN permissions to read-only
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-02-05 04:54:40 +09:00
copilot-swe-agent[bot]
fc6d78a1b6 Add comprehensive CI workflow with multi-platform builds and tests
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-02-05 04:54:40 +09:00
Nyall Dawson
b2aca1ecef Add mingw msys2 workflow 2023-09-06 08:26:34 +10:00
Syoyo Fujita
5a6c55870e Deprecate ubuntu-18.04 image and update CI build configuration. 2023-04-10 18:51:29 +09:00
Syoyo Fujita
240d993f94 Create codeql-analysis.yml 2022-09-02 05:09:09 +09:00
Syoyo Fujita
cfab524125 VS2019 seems gone. Use VS2022. 2022-02-25 01:39:02 +09:00
Syoyo Fujita
9229971bcb Print cmake help 2022-02-25 01:25:15 +09:00
Syoyo Fujita
051149311c Specify x64 for MSVC build. 2022-02-25 01:11:51 +09:00
Syoyo Fujita
34894a6325 Build validator for MSVC build. 2020-05-30 02:28:58 +09:00
Syoyo Fujita
d9c03d041a Build examples for VS2019 build job. 2020-05-30 02:21:07 +09:00
Syoyo Fujita
50a3061ddf Fix path to rapidjson headers 2020-05-30 02:19:47 +09:00
Syoyo Fujita
014dce27f4 Add VS2019 build job. 2020-05-30 02:16:41 +09:00
Syoyo Fujita
c046769054 Add mingw build job 2020-05-30 02:12:48 +09:00
Syoyo Fujita
c43266fdc9 Add argument to loader_example run 2020-05-30 02:07:00 +09:00
Syoyo Fujita
aca196e8d3 add aarch64 cross compile and macos build job. 2020-05-30 02:04:06 +09:00
Syoyo Fujita
b48c027c9a Fix yaml syntax. 2020-05-30 02:00:03 +09:00
Syoyo Fujita
db5c3bea45 Add gcc-4.8 build job. 2020-05-30 01:59:02 +09:00
Syoyo Fujita
ddfa1f2f0b Fix workflow 2020-05-30 01:56:35 +09:00
Syoyo Fujita
7b69c778fe Add rapidjson build job 2020-05-29 22:21:24 +09:00
Syoyo Fujita
73e73bf3c1 Create github actions workflow 2020-05-29 20:57:39 +09:00