diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f80d3cf49..b85bf5356 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,6 +18,25 @@ permissions: jobs: test: + permissions: contents: none - uses: fog/.github/.github/workflows/ruby.yml@v1.1.0 + + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', 'head'] + continue-on-error: ${{ matrix.ruby-version == 'head' }} + + steps: + - uses: actions/checkout@v2.4.0 + - name: Set up dependencies + run: sudo apt-get install libcurl4-openssl-dev + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index ca0945109..e06b62f30 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -3,7 +3,9 @@ require 'fog/core/credentials' module Fog class << self def available_providers - @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).try(:available?)}.sort + available_providers ||= Fog.providers.values.select do |provider| + Kernel.const_defined?(provider) && Kernel.const_get(provider).try(:available?) + end.sort end def registered_providers