-
Notifications
You must be signed in to change notification settings - Fork 464
126 lines (123 loc) · 3.62 KB
/
run_test_suite.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: run-test-suite
on:
push:
branches: [ master, 4-3-stable ]
pull_request:
branches: [ master, 4-3-stable ]
jobs:
test:
services:
# https://github.com/docker-library/docs/blob/master/postgres/README.md
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: ancestry_test
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: ancestry_test
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# this matrix is driven by these sources:
# - https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
# - https://www.ruby-lang.org/en/downloads/branches/
# - https://guides.rubyonrails.org/maintenance_policy.html
format: [materialized_path, materialized_path2]
activerecord: [70, 71, 72]
ruby: [3.2, 3.3]
# additional tests
include:
# EOL 6/2022 (ruby >= 2.2.2, <2.7)
- ruby: 2.6
activerecord: 52
# EOL 2023
- ruby: 2.7
activerecord: 60
# rails 6.1 and 7.0 have different ruby versions
- ruby: 2.7
activerecord: 61
- ruby: "3.0"
activerecord: 61
env:
# for the pg cli (psql, pg_isready) and possibly rails
PGHOST: 127.0.0.1 # container is mapping it locally
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password
# for the mysql cli (mysql, mysqladmin)
MYSQL_HOST: 127.0.0.1
MYSQL_PWD: password
# for rails tests (from matrix)
BUNDLE_GEMFILE: gemfiles/gemfile_${{ matrix.activerecord }}.gemfile
FORMAT: ${{ matrix.format }}
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup Ruby
# https://github.com/ruby/setup-ruby#versioning
# runs 'bundle install' and caches installed gems automatically
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: run sqlite tests
env:
DB: sqlite3
run: |
bundle exec rake
- name: run pg tests
env:
DB: pg
run: |
bundle exec rake
- name: run pg tests (UPDATE_STRATEGY=sql)
env:
DB: pg
UPDATE_STRATEGY: sql
run: |
bundle exec rake
if: ${{ matrix.activerecord != 52 }}
- name: run pg tests (ANCESTRY_COLUMN=ancestry_alt)
env:
DB: pg
ANCESTRY_COLUMN: ancestry_alt
run: |
bundle exec rake
- name: run pg tests (UPDATE_STRATEGY=sql ANCESTRY_COLUMN=ancestry_alt)
env:
DB: pg
ANCESTRY_COLUMN: ancestry_alt
UPDATE_STRATEGY: sql
run: |
bundle exec rake
FORMAT=${{ matrix.format }} UPDATE_STRATEGY=sql bundle exec rake
if: ${{ matrix.activerecord != 52 }}
- name: run mysql tests
env:
DB: mysql2
run: |
bundle exec rake
- name: run mysql tests (ANCESTRY_COLUMN_TYPE=binary)
env:
DB: mysql2
ANCESTRY_COLUMN_TYPE: binary
run: |
bundle exec rake