Skip to content

update CI configuration and demo script to run the demo with Ruby 2.7.8 as a workaround for GitHub Action Ruby limitation. #175

update CI configuration and demo script to run the demo with Ruby 2.7.8 as a workaround for GitHub Action Ruby limitation.

update CI configuration and demo script to run the demo with Ruby 2.7.8 as a workaround for GitHub Action Ruby limitation. #175

Workflow file for this run

name: serpapi-ruby
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1.0'] # test only recommend Ruby version (and stable version on the gitaction server)
# ideally test with those versions, but gitaction are limited
# 2.7.4 is broken.
# 4.0.0 is not supported yet
# ruby-version: ['2.7.4','3.1.0','4.0.0']
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: lint
run: bundle exec rake lint
- name: tests
env:
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
run: bundle exec rake test
- name: oobt
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