-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (41 loc) · 1.3 KB
/
ci.yml
File metadata and controls
41 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: serpapi-ruby
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# 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','head']
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
with:
ruby-version: '2.7.8'
- name: Install and run demo 2.7.8
env:
SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }}
run: rake install && ruby demo/demo.rb