Skip to content

Commit b088f68

Browse files
authored
Merge pull request #2552 from ksss/valgrind
Restrict the execution of the valgrind task to when the C code has been modified.
2 parents 52ea87b + a3466fd commit b088f68

File tree

3 files changed

+40
-24
lines changed

3 files changed

+40
-24
lines changed

.github/workflows/ruby.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,6 @@ jobs:
6565
- name: Run test
6666
run: |
6767
bundle exec rake ${{ matrix.job }}
68-
valgrind:
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v4
72-
- uses: ruby/setup-ruby@v1
73-
with:
74-
ruby-version: "3.4"
75-
bundler-cache: none
76-
- name: Set working directory as safe
77-
run: git config --global --add safe.directory $(pwd)
78-
- name: Install dependencies
79-
run: |
80-
sudo apt-get update
81-
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
82-
- name: Update rubygems & bundler
83-
run: |
84-
ruby -v
85-
gem update --system
86-
- name: bin/setup
87-
run: |
88-
bin/setup
89-
- run: bundle exec rake test:valgrind
90-
env:
91-
RUBY_FREE_AT_EXIT: 1
9268
C99_compile:
9369
runs-on: macos-latest
9470
strategy:

.github/workflows/valgrind.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Valgrind
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "ext/**"
9+
- "include/**"
10+
- "src/**"
11+
pull_request: {}
12+
merge_group: {}
13+
14+
jobs:
15+
valgrind:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: "3.4"
22+
bundler-cache: none
23+
- name: Set working directory as safe
24+
run: git config --global --add safe.directory $(pwd)
25+
- name: Install dependencies
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
29+
- name: Update rubygems & bundler
30+
run: |
31+
ruby -v
32+
gem update --system
33+
- name: bin/setup
34+
run: |
35+
bin/setup
36+
- run: bundle exec rake test:valgrind
37+
env:
38+
RUBY_FREE_AT_EXIT: 1

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ test_config = lambda do |t|
2525
t.test_files = FileList["test/**/*_test.rb"].reject do |path|
2626
path =~ %r{test/stdlib/}
2727
end
28+
t.verbose = true
29+
t.options = '-v'
2830
end
2931

3032
Rake::TestTask.new(test: :compile, &test_config)

0 commit comments

Comments
 (0)