-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.3 KB
/
run_rspec.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
49
50
51
52
53
54
55
56
57
58
59
name: Run Rspec
on:
# Run this workflow from other workflows
workflow_call:
inputs:
db_name:
description: 'Name of Postgres database'
required: true
type: string
ruby_version:
description: 'Version of Ruby to use'
required: true
type: string
env:
DATABASE_URL_TEST: postgresql://postgres:postgres@localhost/${{ inputs.db_name }}
RAILS_ENV: test
jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10ms
--health-timeout 500ms
--health-retries 15
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for focused specs
run: ./scripts/no_focus.sh
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby_version }}
bundler-cache: true
- name: Setup test database
run: bin/rails db:create
- name: Run tests
run: bundle exec rspec