Skip to content

Commit 77133c6

Browse files
committed
.github/workflows/test.yml: update debug print
Changes include: - Remove Rake task dependency to "debug" and "debug_compiler" from "compile" and "test". Let the workflow explicitly run them as necessary. Since we use separate rake invocations for compiling and running tests, the dependency causes repeated debug prints. - Remove printing Ruby version from the debug tasks as it is not necessary. The ruby/setup-ruby action shows the activated version. - Let "debug" rake task call FileUtils#ruby with verbose: false to avoid printing the script itself.
1 parent 29afe47 commit 77133c6

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ jobs:
6060
if: ${{ !matrix.skip-warnings }}
6161

6262
- name: rake compile
63-
run: bundle exec rake compile
63+
run: bundle exec rake debug_compiler compile
64+
65+
- name: rake debug
66+
run: bundle exec rake debug
6467

6568
- name: rake test
6669
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
@@ -158,7 +161,10 @@ jobs:
158161
if: ${{ !matrix.skip-warnings }}
159162

160163
- name: rake compile
161-
run: bundle exec rake compile -- --with-openssl-dir=$HOME/openssl
164+
run: bundle exec rake debug_compiler compile -- --with-openssl-dir=$HOME/openssl
165+
166+
- name: rake debug
167+
run: bundle exec rake debug
162168

163169
- name: rake test
164170
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
@@ -170,6 +176,7 @@ jobs:
170176
run: |
171177
sed -e "s|OPENSSL_DIR|$HOME/openssl|" tool/openssl_fips.cnf.tmpl > tmp/openssl_fips.cnf
172178
export OPENSSL_CONF=$(pwd)/tmp/openssl_fips.cnf
179+
bundle exec rake debug
173180
bundle exec rake test_fips TESTOPTS="-v --no-show-detail-immediately"
174181
timeout-minutes: 5
175182
if: ${{ startsWith(matrix.openssl, 'openssl-3') || matrix.openssl == 'openssl-master' }}

Rakefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ require 'bundler/gem_tasks'
55
begin
66
require 'rake/extensiontask'
77
Rake::ExtensionTask.new('openssl')
8-
# Run the debug_compiler task before the compile task.
9-
Rake::Task['compile'].prerequisites.unshift :debug_compiler
108
rescue LoadError
119
warn "rake-compiler not installed. Run 'bundle install' to " \
1210
"install testing dependency gems."
@@ -51,12 +49,8 @@ RDoc::Task.new do |rdoc|
5149
rdoc.rdoc_files.include("*.md", "lib/**/*.rb", "ext/**/*.c")
5250
end
5351

54-
task :test => [:compile, :debug]
55-
task :test_fips => [:compile, :debug]
56-
5752
# Print Ruby and compiler info for debugging purpose.
5853
task :debug_compiler do
59-
ruby '-v'
6054
compiler = RbConfig::CONFIG['CC']
6155
case compiler
6256
when 'gcc', 'clang'
@@ -82,7 +76,7 @@ task :debug do
8276
Providers: #{providers_str}
8377
MESSAGE
8478
EOF
85-
ruby %Q(-I./lib -ropenssl.so -ve'#{ruby_code}')
79+
ruby %Q(-I./lib -ropenssl.so -e'#{ruby_code}'), verbose: false
8680
end
8781

8882
task :default => :test

0 commit comments

Comments
 (0)