-
Notifications
You must be signed in to change notification settings - Fork 68
50 lines (50 loc) · 1.54 KB
/
ci-workflow.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
name: CI
on: [push, pull_request]
jobs:
test:
name: 'Test (Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.rails }}, DB: ${{ matrix.db }})'
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.3', '3.2', '3.1', '3.0']
rails: ['7.1', '7.0', '6.1']
db: [mysql, postgres, sqlite]
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/spec/support/gemfiles/Gemfile.rails-${{ matrix.rails }}.x
DB: ${{ matrix.db }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: double_entry_test
MYSQL_USER: mysql
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: double_entry_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: cp spec/support/database.ci.yml spec/support/database.yml
- run: bundle exec rspec
- run: ruby script/jack_hammer -t 2000