diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baa45d9..cbcc85f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: # 4.0.0 is not supported yet # ruby-version: ['2.7.4','3.1.0','4.0.0'] 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 @@ -32,3 +32,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 diff --git a/.gitignore b/.gitignore index 00f8b34..0f32379 100644 --- a/.gitignore +++ b/.gitignore @@ -30,9 +30,6 @@ test.rb ## Text Editor .vscode -Gemfile.lock -build_table.rb - # local script only /script README_ruby_EXAMPLE_SECTION.md diff --git a/demo/demo.rb b/demo/demo.rb index a0af3ec..3b9add1 100644 --- a/demo/demo.rb +++ b/demo/demo.rb @@ -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',