-
-
Notifications
You must be signed in to change notification settings - Fork 47
84 lines (71 loc) · 2.29 KB
/
tests.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: RSpec tests
on:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: root
POSTGRES_DB: database_consistency_test
POSTGRES_PASSWORD: database_consistency_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql
env:
MYSQL_ROOT_HOST: "%"
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: database_consistency_password
MYSQL_DATABASE: database_consistency_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_HOST: 127.0.0.1
DB_USER: root
DB_PASSWORD: database_consistency_password
strategy:
matrix:
include:
- ruby-version: '2.6'
gemfile: 'gemfiles/ar_4_2.gemfile'
- ruby-version: '2.7'
gemfile: 'gemfiles/ar_5_2.gemfile'
- ruby-version: '3.0'
gemfile: 'gemfiles/ar_6_0.gemfile'
- ruby-version: '3.1'
gemfile: 'gemfiles/ar_6_1.gemfile'
- ruby-version: '3.2'
gemfile: 'gemfiles/ar_7_0.gemfile'
- ruby-version: '3.2'
gemfile: 'gemfiles/ar_7_1.gemfile'
- ruby-version: 'head'
gemfile: 'gemfiles/ar_main.gemfile'
continue-on-error: ${{ contains(matrix.ruby-version, 'head') || contains(matrix.gemfile, 'ar_main') }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Use << parameters.gemfile >> as the Gemfile
run: bundle config --global gemfile ${{ matrix.gemfile }}
- name: Install dependencies
run: bundle install
- name: Run SQLite tests
run: bundle exec rspec
- name: Run MySQL tests
run: DATABASE=mysql bundle exec rspec
- name: Run PostgreSQL tests
run: DATABASE=postgresql bundle exec rspec