Skip to content

Commit

Permalink
Setup ruby_memcheck
Browse files Browse the repository at this point in the history
Hoping it might find the leak reported in ruby#460
  • Loading branch information
byroot committed Oct 30, 2024
1 parent 942cd3f commit 995aab9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,26 @@ jobs:

- run: gem install pkg/*.gem
if: ${{ matrix.ruby != '3.2' }}

valgrind:
name: Ruby memcheck
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: "3.3"
apt-get: ragel valgrind

- run: |
bundle config --without benchmark
bundle install
- run: rake compile

- run: rake valgrind
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else
end

group :development do
gem "ruby_memcheck"
gem "ostruct"
gem "rake"
gem "rake-compiler"
Expand Down
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "ruby_memcheck"

begin
require 'rubygems/package_task'
rescue LoadError
Expand Down Expand Up @@ -250,6 +252,12 @@ else
t.options = '-v'
end

RubyMemcheck::TestTask.new(valgrind: [ :set_env_ext, :check_env, :compile, :do_test_ext ]) do |t|
t.test_files = FileList['test/json/*_test.rb']
t.verbose = true
t.options = '-v'
end

desc "Update the tags file"
task :tags do
system 'ctags', *Dir['**/*.{rb,c,h,java}']
Expand Down

0 comments on commit 995aab9

Please sign in to comment.