-
Notifications
You must be signed in to change notification settings - Fork 143
56 lines (54 loc) · 1.33 KB
/
ci.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
name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# https://rubyonrails.org/category/releases
# https://rubyonrails.org/maintenance
rails:
- 7.0.0
- 7.1.0
- 7.2.0
- 8.0.0
# https://www.ruby-lang.org/en/downloads/
ruby:
- 3.1.6
- 3.2.6
- 3.3.6
exclude:
# rails 8.0.x needs Ruby version >= 3.2
- rails: 8.0.0
ruby: 3.1.6
services:
postgres:
image: postgres:17.1-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_VERSION: ${{ matrix.rails }}
RUBY_VERSION: ${{ matrix.ruby }}
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up database schema
run: bundle exec rake db:migrate --trace
- name: Run tests
run: bundle exec rspec spec