diff --git a/.github/workflows/cbindgen.yml b/.github/workflows/cbindgen.yml new file mode 100644 index 0000000..ba83248 --- /dev/null +++ b/.github/workflows/cbindgen.yml @@ -0,0 +1,17 @@ +name: cbindgen +on: [push, pull_request] + +jobs: + header_check: + runs-on: ubuntu-latest + name: Check cbindgen + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo install --force cbindgen + - run: bundle exec rake cbindgen + - run: git diff --no-ext-diff --ignore-submodules --exit-code diff --git a/Rakefile b/Rakefile index 6135499..5fd8139 100644 --- a/Rakefile +++ b/Rakefile @@ -39,6 +39,12 @@ namespace :install do task(release: :"compile:release", &install_task) end +task :cbindgen do + Dir.chdir("gc/mmtk") do + sh("cbindgen --config cbindgen.toml --output mmtk.h") + end +end + RUBY_HEADERS = %w[ ccan/check_type/check_type.h ccan/container_of/container_of.h ccan/list/list.h ccan/str/str.h gc/gc_impl.h gc/gc.h gc/extconf_base.rb diff --git a/gc/mmtk/mmtk.h b/gc/mmtk/mmtk.h index 872c273..02927f5 100644 --- a/gc/mmtk/mmtk.h +++ b/gc/mmtk/mmtk.h @@ -149,4 +149,4 @@ size_t mmtk_worker_count(void); bool mmtk_is_mmtk_object(MMTk_Address addr); -#endif /* MMTK_H */ +#endif /* MMTK_H */