From b758ccd099a83491ff093aebdebfdb1a86790377 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Wed, 8 Apr 2026 13:03:54 +0900 Subject: [PATCH] Add Clang compilation CI job on macOS Add a clang_compile job to verify that the C extension compiles cleanly with Clang, enabling nullability checks via -Wnullable-to-nonnull-conversion. The job runs on macOS where Ruby is built with Apple Clang, so mkmf's flag checks use the correct compiler. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ruby.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1836e10e6..4d9cb040d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -110,3 +110,37 @@ jobs: run: | bin/setup - run: bundle exec rake clean compile_c99 + + clang_compile: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ruby: ['4.0', head] + steps: + - uses: actions/checkout@v6 + - name: Install dependencies + run: | + brew install ruby-build + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler: none + - name: Set working directory as safe + run: git config --global --add safe.directory $(pwd) + - name: Update rubygems & bundler + run: | + ruby -v + gem update --system + - name: install erb + run: gem install erb + - name: clang version + run: clang --version + - name: bundle config set force_ruby_platform true if head + if: ${{ contains(matrix.ruby, 'head') }} + run: | + bundle config set force_ruby_platform true + - name: bin/setup + run: | + bin/setup + - run: bundle exec rake clean compile