diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a93059..8b65a97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 \ No newline at end of file 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',