-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (71 loc) · 2.07 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
name: test
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: read
jobs:
test:
name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}.gemfile, PG ${{ matrix.postgres }}
runs-on: ubuntu-latest
services:
test-postgres:
image: postgres:${{ matrix.postgres }}
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: foobar123
strategy:
matrix:
include:
# old
- { gemfile: 'rails_7.1', ruby: '3.3', postgres: '15' }
- { gemfile: 'rails_7.1', ruby: '3.3', postgres: '16' }
# current
- { gemfile: 'rails_7.2', ruby: '3.3', postgres: '16' }
- { gemfile: 'rails_7.2', ruby: '3.3', postgres: '17' }
# modern
- { gemfile: 'rails_8.0', ruby: '3.3', postgres: '16', experimental: true }
- { gemfile: 'rails_8.0', ruby: '3.3', postgres: '17', experimental: true }
# futuristic
- { gemfile: 'rails_8.0', ruby: 'head', postgres: '17', experimental: true }
continue-on-error: ${{ matrix.experimental || false }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
- name: Create database
run: |
createdb \
--host=$POSTGRES_HOST \
--port=$POSTGRES_PORT \
--username=postgres \
dummy
env:
PGPASSWORD: foobar123
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run specs
run:
bundle exec rake install_database_yml spec && bundle exec rake testing_spec
env:
BACKTRACE: 1
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
DB: postgres
IRONTRAIL_CI_DATABASE: dummy
IRONTRAIL_CI_DB_USER: postgres
IRONTRAIL_CI_DB_PASSWORD: foobar123
IRONTRAIL_CI_DB_HOST: 127.0.0.1
IRONTRAIL_CI_DB_PORT: 5432