Skip to content

Commit

Permalink
Add a CI test for basic rubygems functionality without openssl
Browse files Browse the repository at this point in the history
The whole test suite actually passes on my system, but it has weird
errors in CI. Since I don't want to spend time on it, instead of running
the whole test suite, I'm just adding a bare test to check that `gem
list` works.
  • Loading branch information
deivid-rodriguez committed Jul 19, 2020
1 parent 41976ef commit a40d9a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/install-rubygems.yml
Expand Up @@ -14,6 +14,7 @@ jobs:
strategy:
matrix:
ruby: [ 2.3.8, 2.4.10, 2.5.8, 2.6.6, 2.7.1, jruby-9.2.11.1 ]
openssl: [true, false]
steps:
- uses: actions/checkout@v2
- name: Setup ruby
Expand All @@ -25,6 +26,11 @@ jobs:
run: ruby -Ilib -S rake install 2> errors.txt
- name: Check rubygems install produced no warnings
run: test ! -s errors.txt || (cat errors.txt && exit 1)
- name: Simulate no openssl
run: ruby util/remove_openssl.rb
if: matrix.openssl == false
- name: Run installed rubygems
run: gem list bundler
- name: Run bundler installed as a default gem
run: bundle --version
- name: Check bundler man pages were installed and are properly picked up
Expand Down
21 changes: 21 additions & 0 deletions util/remove_openssl.rb
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require "rbconfig"
require "fileutils"

archdir = RbConfig::CONFIG["archdir"]
rubylibdir = RbConfig::CONFIG["rubylibdir"]
default_specifications_dir = Gem.default_specifications_dir

openssl_rb = File.join(rubylibdir, "openssl.rb")
openssl_gemspec = Dir.glob("#{default_specifications_dir}/openssl-*.gemspec").first

openssl_ext = if RUBY_PLATFORM == "java"
File.join(rubylibdir, "jopenssl.jar")
else
File.join(archdir, "openssl.so")
end

FileUtils.mv openssl_rb, openssl_rb + "_"
FileUtils.mv openssl_ext, openssl_ext + "_"
FileUtils.mv openssl_gemspec, openssl_gemspec + "_" if openssl_gemspec

0 comments on commit a40d9a3

Please sign in to comment.