Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1.0','head'] # test only recommend Ruby version (and stable version on the gitaction server)
# ruby-version: ['2.7.4','3.1.0','head']
# test only recommend Ruby version (and stable version on the gitaction server)
# GitHub action github.com/ruby/setup-ruby is pretty unstable with older Ruby version + dependencies
# so, we only run a basic example with Ruby 2.7.8 after install the gem from the local build
ruby-version: ['3.1.0','3.4.5']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
Expand All @@ -29,3 +31,15 @@ jobs:
env:
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
run: bundle exec rake oobt
- name: Run example with ruby 2.7.8
uses: ruby/setup-ruby@v1
if: matrix.ruby-version == '3.1.0'
with:
ruby-version: '2.7.8'
- name: Install and run demo 2.7.8
if: matrix.ruby-version == '3.1.0'
env:
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
run: |
gem install ./serpapi-*.gem
ruby demo/demo.rb
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ test.rb
## Text Editor
.vscode

Gemfile.lock
build_table.rb

# local script only
/script
README_ruby_EXAMPLE_SECTION.md
2 changes: 2 additions & 0 deletions demo/demo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
require 'pp'
require 'serpapi'

puts "SerpApi Ruby Client Example with Ruby version: #{RUBY_VERSION}"

# client initialization with default parameters
client = SerpApi::Client.new(
engine: 'google',
Expand Down
Loading