-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (90 loc) · 2.6 KB
/
main.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
85
86
87
88
89
90
91
92
93
94
name: Push & PR
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: mysql-7.0
- name: Rubocop
run: bundle exec rubocop
rspec:
name: RSpec
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
activerecord: ['6.1', '7.0']
ruby: ['2.7', '3.1', '3.2']
exclude:
- activerecord: '6.1'
ruby: '3.2'
- activerecord: '6.1'
ruby: '3.1'
- activerecord: '7.0'
ruby: '2.7'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: dummy
POSTGRES_USER: root
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready --health-interval 10s
--health-timeout 5s --health-retries 5
sql.data:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password1234
ports:
- 1433:1433
env:
BUNDLE_WITH: mysql postgres sqlserver
MYSQL_URL: mysql2://root@127.0.0.1:3306/test
POSTGRES_URL: postgres://root:dummy@127.0.0.1:5432/test
RAILS: ${{ matrix.activerecord }}
RAILS_ENV: test
SQLSERVER_URL: sqlserver://sa:Password1234@127.0.0.1:1433/test
steps:
- name: Setup FreeTDS
run: |
sudo apt-get install -y freetds-bin freetds-common freetds-dev libct4 libsybdb5
- name: Wait for SQLServer
run: |
until echo -e "SELECT @@VERSION\nGO" | tsql -H 127.0.0.1 -p 1433 -U sa -P Password1234;
do
echo 'Waiting for SqlServer ...'
sleep 2
done
- name: Create SQLServer Test DB
run: echo -e "CREATE DATABASE test\nGO" | tsql -H 127.0.0.1 -p 1433 -U sa -P Password1234
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: ${{ matrix.activerecord }}
- name: RSpec
timeout-minutes: 2
run: bundle exec rspec