File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,15 +13,39 @@ jobs:
1313 test :
1414 runs-on : ubuntu-latest
1515
16+ services :
17+ postgres :
18+ image : postgres:latest
19+ env :
20+ POSTGRES_USER : postgres
21+ POSTGRES_PASSWORD : postgres
22+ POSTGRES_HOST : localhost
23+ options : >-
24+ --health-cmd pg_isready
25+ --health-interval 10s
26+ --health-timeout 5s
27+ --health-retries 5
28+ ports :
29+ - 5432:5432
30+
1631 steps :
17- - uses : actions/checkout@v4
32+ - name : Setup system dependencies
33+ run : sudo apt-get install -y libpq-dev postgresql-server-dev-16
34+
35+ # https://github.com/actions/checkout
36+ - uses : actions/checkout@v6
37+
1838 - name : Set up Ruby
1939 # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
20- # change this to (see https://github.com/ruby/setup-ruby#versioning):
21- # uses: ruby/setup-ruby@v1
40+ # use ruby/setup-ruby@v1. See https://github.com/ruby/setup-ruby
2241 uses : ruby/setup-ruby@v1
2342 with :
2443 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
44+
2545 - name : Run tests
2646 run : bundle exec rake spec
27-
47+ env :
48+ JUNETHACK_POSTGRES_USER : postgres
49+ JUNETHACK_POSTGRES_PASSWORD : postgres
50+ JUNETHACK_POSTGRES_HOST : localhost
51+ JUNETHACK_POSTGRES_DATABASE : postgres
Original file line number Diff line number Diff line change 1- development :
1+ production :
22 adapter : postgresql
3- database : junethack-dev
3+ database : <%= ENV['JUNETHACK_POSTGRES_DATABASE'] || 'junethack' %>
4+ host : <%= ENV['JUNETHACK_POSTGRES_HOST'] || 'localhost' %>
5+ username : <%= ENV['JUNETHACK_POSTGRES_USER'] || 'junethack' %>
6+ password : <%= ENV['JUNETHACK_POSTGRES_PASSWORD'] || 'test' %>
47
5- production :
8+ development :
69 adapter : postgresql
7- database : junethack-prod
10+ database : <%= ENV['JUNETHACK_POSTGRES_DATABASE'] || 'junethack-dev' %>
11+ host : <%= ENV['JUNETHACK_POSTGRES_HOST'] || 'localhost' %>
12+ username : <%= ENV['JUNETHACK_POSTGRES_USER'] || 'junethack' %>
13+ password : <%= ENV['JUNETHACK_POSTGRES_PASSWORD'] || 'test' %>
814
915test :
1016 adapter : postgresql
11- database : junethack-test
12- user : junethack
13- password : junethack
17+ database : <%= ENV['JUNETHACK_POSTGRES_DATABASE'] || 'junethack-test' %>
18+ host : <%= ENV['JUNETHACK_POSTGRES_HOST'] || 'localhost' %>
19+ username : <%= ENV['JUNETHACK_POSTGRES_USER'] || 'junethack' %>
20+ password : <%= ENV['JUNETHACK_POSTGRES_PASSWORD'] || 'test' %>
Original file line number Diff line number Diff line change 99
1010ActiveRecord . schema_format = :sql
1111
12+ Dir . mkdir ( 'logs' ) unless File . exist? ( 'logs' )
13+
1214configure :development do
1315 puts "Configuring development database"
1416 ActiveRecord ::Base . logger = Logger . new ( "logs/dev_db.log" )
You can’t perform that action at this time.
0 commit comments