Repository navigation
209 lines (200 loc) · 5.8 KB
/
Copy pathruby.yaml
File metadata and controls
209 lines (200 loc) · 5.8 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Ruby
# Filter the workflow so unrelated changes create no skipped matrix jobs.
# Keep both events' paths in sync.
on:
push:
branches: [master]
paths:
- ".github/workflows/ruby.yaml"
- "Makefile"
- "conformance/**"
- "riverdriver/**/*.sql"
- "ruby/**"
tags: ["ruby/v*"]
pull_request:
paths:
- ".github/workflows/ruby.yaml"
- "Makefile"
- "conformance/**"
- "riverdriver/**/*.sql"
- "ruby/**"
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
defaults:
run:
working-directory: ruby
jobs:
checks:
# Check coverage from the two backends without adding another CI job.
needs: [test, test_sqlite]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
working-directory: ruby
bundler-cache: true
- run: bundle exec standardrb
- run: make frozen-string-literals type-check verify build
- uses: actions/download-artifact@v8
with:
pattern: ruby-coverage-*
path: ruby/coverage/ci
- run: bundle exec ruby scripts/check_coverage.rb
test:
name: test (${{ matrix.ruby }}, ${{ matrix.postgres }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
# Latest Ruby against all supported Postgres versions.
- ruby: "4.0"
postgres: 18
primary: true
- ruby: "4.0"
postgres: 17
- ruby: "4.0"
postgres: 16
- ruby: "4.0"
postgres: 15
- ruby: "4.0"
postgres: 14
# Older Ruby versions against the latest Postgres only.
- ruby: "3.4"
postgres: 18
- ruby: "3.3"
postgres: 18
- ruby: "3.2"
postgres: 18
env:
RIVER_REQUIRE_DATABASES: "1"
TEST_DATABASE: postgres
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_test?sslmode=disable
services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_DB: river_test
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 2s
--health-timeout 5s
--health-retries 5
ports: ["5432:5432"]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
working-directory: ruby
bundler-cache: true
- uses: actions/setup-go@v7
with:
go-version-file: go.work
- run: make generate/fixtures
- run: make spec/core
- run: bundle install
working-directory: ruby/driver/riverqueue-activerecord
- run: make spec/activerecord
- run: bundle install
working-directory: ruby/driver/riverqueue-sequel
- run: make spec/sequel
- uses: actions/upload-artifact@v7
if: matrix.primary
with:
name: ruby-coverage-postgres
path: ruby/**/coverage/.resultset.json
include-hidden-files: true
if-no-files-found: error
retention-days: 1
test_sqlite:
name: test_sqlite (4.0)
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RIVER_REQUIRE_DATABASES: "1"
TEST_DATABASE: sqlite
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
working-directory: ruby
bundler-cache: true
- uses: actions/setup-go@v7
with:
go-version-file: go.work
- run: make generate/fixtures
- run: make spec/core
- run: bundle install
working-directory: ruby/driver/riverqueue-activerecord
- run: make spec/activerecord
- run: bundle install
working-directory: ruby/driver/riverqueue-sequel
- run: make spec/sequel
- uses: actions/upload-artifact@v7
with:
name: ruby-coverage-sqlite
path: ruby/**/coverage/.resultset.json
include-hidden-files: true
if-no-files-found: error
retention-days: 1
rails:
name: rails (4.0)
runs-on: ubuntu-latest
timeout-minutes: 10
env:
BUNDLE_FROZEN: "false"
RIVER_REQUIRE_DATABASES: "1"
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_test?sslmode=disable
services:
postgres:
image: postgres:18
env:
POSTGRES_DB: river_test
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 2s
--health-timeout 5s
--health-retries 5
ports: ["5432:5432"]
defaults:
run:
working-directory: ruby/rails/riverqueue-rails
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
working-directory: ruby/rails/riverqueue-rails
# Reuse the runner, Postgres service, and installed gems across versions.
- name: Test Rails 7.2
env:
RAILS_VERSION: "~> 7.2.0"
run: bundle install && bundle exec rspec
- name: Test Rails 8.0
if: success() || failure()
env:
RAILS_VERSION: "~> 8.0.0"
run: bundle install && bundle exec rspec
- name: Test Rails 8.1
if: success() || failure()
env:
RAILS_VERSION: "~> 8.1.0"
run: bundle install && bundle exec rspec