-
Notifications
You must be signed in to change notification settings - Fork 617
154 lines (154 loc) · 4.51 KB
/
test.yaml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Test
on: [push, pull_request]
jobs:
test:
services:
postgres:
image: postgis/postgis:10-2.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_HOST: 127.0.0.1
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: github
MYSQL_PASSWORD: github
MYSQL_DATABASE: activerecord_import_test
options: >-
--health-cmd "mysqladmin ping -h localhost"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby:
- 3.3
env:
- AR_VERSION: '7.2'
RUBYOPT: --enable-frozen-string-literal
- AR_VERSION: '7.1'
RUBYOPT: --enable-frozen-string-literal
- AR_VERSION: '7.0'
RUBYOPT: --enable-frozen-string-literal
- AR_VERSION: 6.1
RUBYOPT: --enable-frozen-string-literal
include:
- ruby: 3.2
env:
AR_VERSION: '7.2'
- ruby: 3.2
env:
AR_VERSION: '7.1'
- ruby: 3.2
env:
AR_VERSION: '7.0'
- ruby: 3.2
env:
AR_VERSION: 6.1
- ruby: 3.1
env:
AR_VERSION: '7.1'
- ruby: 3.1
env:
AR_VERSION: '7.0'
- ruby: 3.1
env:
AR_VERSION: 6.1
- ruby: '3.0'
env:
AR_VERSION: '7.0'
- ruby: '3.0'
env:
AR_VERSION: 6.1
- ruby: jruby-9.4.8.0
env:
AR_VERSION: '7.0'
- ruby: 2.7
env:
AR_VERSION: '7.0'
- ruby: 2.7
env:
AR_VERSION: 6.1
- ruby: 2.7
env:
AR_VERSION: '6.0'
- ruby: jruby-9.3.15.0
env:
AR_VERSION: '6.1'
- ruby: 2.6
env:
AR_VERSION: 5.2
runs-on: ubuntu-latest
env:
AR_VERSION: ${{ matrix.env.AR_VERSION }}
DB_DATABASE: activerecord_import_test
steps:
- uses: actions/checkout@v4
- name: Install SQLite3 Development Library
run: |
sudo apt-get update
sudo apt-get install libsqlite3-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest
- name: Set up databases
run: |
psql -h localhost -U postgres -c 'create database ${{ env.DB_DATABASE }};'
psql -h localhost -U postgres -d ${{ env.DB_DATABASE }} -c 'create extension if not exists hstore;'
psql -h localhost -U postgres -c 'create extension if not exists postgis;'
psql -h localhost -U postgres -c 'create extension if not exists "uuid-ossp";'
cp test/github/database.yml test/database.yml
env:
PGPASSWORD: postgres
- name: Run tests with mysql2
run: |
bundle exec rake test:mysql2
bundle exec rake test:mysql2_makara
bundle exec rake test:mysql2spatial
- name: Run tests with postgresql
run: |
bundle exec rake test:postgis
bundle exec rake test:postgresql
bundle exec rake test:postgresql_makara
- name: Run tests with seamless_database_pool
run: |
bundle exec rake test:seamless_database_pool
if: ${{ matrix.ruby < '3.0' }}
- name: Run tests with sqlite
run: |
bundle exec rake test:spatialite
bundle exec rake test:sqlite3
- name: Run trilogy tests
if: ${{ matrix.env.AR_VERSION >= '7.0' && !startsWith(matrix.ruby, 'jruby') }}
run: bundle exec rake test:trilogy
lint:
runs-on: ubuntu-latest
env:
AR_VERSION: '7.0'
steps:
- uses: actions/checkout@v4
- name: Install SQLite3 Development Library
run: |
sudo apt-get update
sudo apt-get install libsqlite3-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop