-
Notifications
You must be signed in to change notification settings - Fork 864
154 lines (150 loc) · 4.08 KB
/
test.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
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 Suite
'on':
- push
- pull_request
jobs:
test-rails:
strategy:
fail-fast: false
matrix:
ruby:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
gemfile:
- Gemfile
- environments/Gemfile.rails5.0.rb
- environments/Gemfile.rails5.1.rb
- environments/Gemfile.rails5.2.rb
- environments/Gemfile.rails6.0.rb
- environments/Gemfile.rails6.1.rb
- environments/Gemfile.rails-edge.rb
exclude:
- ruby: '2.4'
gemfile: Gemfile
- ruby: '2.5'
gemfile: Gemfile
- ruby: '2.6'
gemfile: Gemfile
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.0.rb
- ruby: '3.1'
gemfile: environments/Gemfile.rails5.0.rb
- ruby: '3.2'
gemfile: environments/Gemfile.rails5.0.rb
- ruby: '3.3'
gemfile: environments/Gemfile.rails5.0.rb
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.1.rb
- ruby: '3.1'
gemfile: environments/Gemfile.rails5.1.rb
- ruby: '3.2'
gemfile: environments/Gemfile.rails5.1.rb
- ruby: '3.3'
gemfile: environments/Gemfile.rails5.1.rb
- ruby: '3.0'
gemfile: environments/Gemfile.rails5.2.rb
- ruby: '3.1'
gemfile: environments/Gemfile.rails5.2.rb
- ruby: '3.2'
gemfile: environments/Gemfile.rails5.2.rb
- ruby: '3.3'
gemfile: environments/Gemfile.rails5.2.rb
- ruby: '2.4'
gemfile: environments/Gemfile.rails6.0.rb
- ruby: '2.4'
gemfile: environments/Gemfile.rails6.1.rb
- ruby: '2.4'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '2.5'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '2.6'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '2.7'
gemfile: environments/Gemfile.rails-edge.rb
- ruby: '3.0'
gemfile: environments/Gemfile.rails-edge.rb
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: will_paginate
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3306:3306
postgres:
image: postgres:11
env:
POSTGRES_DB: will_paginate
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- name: Run tests
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
run: |
docker-wait() {
local container
container="$(docker ps -q -f ancestor=$1)"
timeout 90s bash -c "until docker exec $container $2; do sleep 5; done"
}
docker-wait postgres:11 "pg_isready"
docker-wait mysql:5.7 "mysqladmin ping"
bundler binstubs rspec-core
script/test_all
test-nonrails:
strategy:
fail-fast: false
matrix:
ruby:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: environments/Gemfile.non-rails.rb
services:
mongodb:
image: mongo:4.2
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- name: Run tests
run: |
docker-wait() {
local container
container="$(docker ps -q -f ancestor=$1)"
timeout 90s bash -c "until docker exec $container $2; do sleep 5; done"
}
docker-wait mongo:4.2 "mongo --quiet"
bundler binstubs rspec-core
script/test_all