-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (75 loc) · 2.11 KB
/
rspec.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
---
name: RSpec
on:
push:
branches:
- main
- development
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
- '.github/**'
pull_request:
branches:
- main
- development
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
- '.github/**'
jobs:
rspec:
name: Unit Tests with RSepc
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
env:
RAILS_ENV: development
RAILS_MAX_THREADS: 2
WEB_CONCURRENCY: 2
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
POSTGRES_HOST: localhost
POSTGRES_PORT: '5432'
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: '5432'
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
PGPASSFILE: /app/.pgpass
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_MAX_CONNECTIONS: '30'
POSTGRES_RANDOM_PAGE_COST: '1.1'
POSTGRES_EFFECTIVE_IO_CONCURRENCY: '30'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dependences
run: |
sudo apt-get update -y
sudo apt-get install -y libpq-dev postgresql-client build-essential libssl-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
- name: Bundle Install
run: bundle install
- name: Database Setup
run: |
psql "postgresql://${{ secrets.POSTGRES_USER }}:${{ secrets.POSTGRES_PASSWORD }}@postgres:5432" << EOF
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
EOF
bundle exec rails db:migrate
- name: Run RSpec
run: bundle exec rspec