-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (48 loc) · 1.42 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
name: Test
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
postgres: ['16-bullseye', '15-bullseye', '14-bullseye', '13-bullseye', '12-bullseye']
name: Ruby ${{ matrix.ruby }} - PostgreSQL ${{ matrix.postgres }}
# https://docs.github.com/en/actions/learn-github-actions/expressions#example
runs-on: ${{ matrix.ruby == '2.7' && 'ubuntu-20.04' || 'ubuntu-latest' }}
services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_USER: ubuntu
POSTGRES_DB: rspec_profiling_test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
PGHOST: localhost
PGUSER: ubuntu
GEMFILE: gemfiles/spec.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Installing dependencies
run: bundle install
- name: Initialize empty database
run: bundle exec rake rspec_profiling:install
- name: Run tests
run: bundle exec rake