-
Notifications
You must be signed in to change notification settings - Fork 73
43 lines (40 loc) · 1.35 KB
/
ruby.yml
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
42
43
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: "Ruby ${{ matrix.ruby-version }} ActiveSupport: ${{matrix.activesupport-version}} Sinatra ${{matrix.sinatra-version}}"
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2']
activesupport-version: ['6', '7']
sinatra-version: ['2', '3', '4']
env:
ACTIVESUPPORT_MAJOR: ${{ matrix.activesupport-version }}
SINATRA_MAJOR: ${{ matrix.sinatra-version }}
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: password
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: PGPASSWORD=password psql -U postgres -h localhost -c 'CREATE DATABASE plinygemtest;'
- run: PGPASSWORD=password psql -U postgres -h localhost -c 'CREATE DATABASE integrationtest;'
- name: Run tests
run: bundle exec rake
env:
TEST_DATABASE_URL: "postgres://postgres:password@localhost/plinygemtest"
DATABASE_URL: "postgres://postgres:password@localhost/integrationtest"