-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (66 loc) · 2.02 KB
/
ruby.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
env:
RAILS_ENV: test
MEDUZA_DATABASE_URL: 'postgres://postgres:[email protected]/meduza_test'
PGPASSWORD: postgres
PGUSER: postgres
PGHOST: 127.0.0.1
REDIS_URL: redis://localhost:6379
BITZLATO_FREEZE_API_KEY: test_key
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['2.7.4']
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:13
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# required
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Bundle install
run: bundle install
- name: Setup database
run: bundle exec rake db:create db:schema:load db:migrate
- name: Setup public database
run: cat ./db/public.structure.sql | bundle exec rails dbconsole
- run: bundle exec rake