Skip to content

Commit fdcc77a

Browse files
committed
update CI configuration and demo script to run the demo with Ruby 2.7.8 as a workaround for GitHub Action Ruby limitation.
1 parent 37c17ae commit fdcc77a

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
ruby-version: ['3.1.0','head'] # test only recommend Ruby version (and stable version on the gitaction server)
13-
# ruby-version: ['2.7.4','3.1.0','head']
12+
# test only recommend Ruby version (and stable version on the gitaction server)
13+
# GitHub action github.com/ruby/setup-ruby is pretty unstable with older Ruby version + dependencies
14+
# so, we only run a basic example with Ruby 2.7.8 after install the gem from the local build
15+
ruby-version: ['3.1.0','head']
1416
steps:
15-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1618
- name: Set up Ruby ${{ matrix.ruby-version }}
17-
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
19+
uses: ruby/setup-ruby@v1
1820
with:
1921
ruby-version: ${{ matrix.ruby-version }}
2022
- name: Install dependencies
@@ -29,3 +31,11 @@ jobs:
2931
env:
3032
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
3133
run: bundle exec rake oobt
34+
- name: Run example with ruby 2.7.8
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: '2.7.8'
38+
- name: Install and run demo 2.7.8
39+
env:
40+
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
41+
run: rake install && ruby demo/demo.rb

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ test.rb
3030
## Text Editor
3131
.vscode
3232

33-
Gemfile.lock
34-
build_table.rb
35-
3633
# local script only
3734
/script
3835
README_ruby_EXAMPLE_SECTION.md

demo/demo.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
require 'pp'
1010
require 'serpapi'
1111

12+
puts "SerpApi Ruby Client Example with Ruby version: #{RUBY_VERSION}"
13+
1214
# client initialization with default parameters
1315
client = SerpApi::Client.new(
1416
engine: 'google',

0 commit comments

Comments
 (0)