File tree Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 22
22
23
23
- name : Run Ruby tests
24
24
run : bundle exec rake
25
+
26
+ memcheck :
27
+ runs-on : ubuntu-latest
28
+
29
+ steps :
30
+ - name : Install valgrind from source
31
+ run : |
32
+ sudo apt-get install -y libc6-dbg
33
+ wget https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2
34
+ tar xvf valgrind-3.20.0.tar.bz2
35
+ cd valgrind-3.20.0
36
+ ./configure
37
+ make
38
+ sudo make install
39
+
40
+ - uses : actions/checkout@v2
41
+
42
+ - name : Set up Ruby
43
+ uses : ruby/setup-ruby@v1
44
+ with :
45
+ ruby-version : head
46
+ bundler-cache : true
47
+
48
+ - name : Run Ruby tests with valgrind
49
+ run : bundle exec rake test:valgrind
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ ruby ">= 3.1.0"
7
7
gem "rake"
8
8
gem "rake-compiler"
9
9
gem "test-unit"
10
+ gem "ruby_memcheck"
Original file line number Diff line number Diff line change 1
1
GEM
2
2
remote: https://rubygems.org/
3
3
specs:
4
+ mini_portile2 (2.8.1 )
5
+ nokogiri (1.14.2 )
6
+ mini_portile2 (~> 2.8.0 )
7
+ racc (~> 1.4 )
4
8
power_assert (2.0.1 )
9
+ racc (1.6.2 )
5
10
rake (13.0.6 )
6
11
rake-compiler (1.2.0 )
7
12
rake
13
+ ruby_memcheck (1.2.0 )
14
+ nokogiri
8
15
test-unit (3.5.3 )
9
16
power_assert
10
17
@@ -14,6 +21,7 @@ PLATFORMS
14
21
DEPENDENCIES
15
22
rake
16
23
rake-compiler
24
+ ruby_memcheck
17
25
test-unit
18
26
19
27
RUBY VERSION
Original file line number Diff line number Diff line change 3
3
require "rake/extensiontask"
4
4
require "rake/testtask"
5
5
require "rake/clean"
6
+ require "ruby_memcheck"
7
+
8
+ RubyMemcheck . config ( binary_name : "yarp" )
6
9
7
10
task compile : :make
8
11
@@ -13,12 +16,18 @@ Rake::ExtensionTask.new(:compile) do |ext|
13
16
ext . gem_spec = Gem ::Specification . load ( "yarp.gemspec" )
14
17
end
15
18
16
- Rake :: TestTask . new ( test : :compile ) do |t |
19
+ test_config = lambda do |t |
17
20
t . libs << "test"
18
21
t . libs << "lib"
19
22
t . test_files = FileList [ "test/**/*_test.rb" ]
20
23
end
21
24
25
+ Rake ::TestTask . new ( test : :compile , &test_config )
26
+
27
+ namespace :test do
28
+ RubyMemcheck ::TestTask . new ( valgrind : :compile , &test_config )
29
+ end
30
+
22
31
task default : :test
23
32
24
33
TEMPLATES = [
You can’t perform that action at this time.
0 commit comments