-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Howto connect #4
Comments
+1 |
it uses default port 5432 on localhost. You can change database by using keys below with:
|
I have below job syntax: name: Ruby
on: [push]
jobs:
unit_tests:
name: 'Run unit tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '11'
postgresql db: 'surveymaster_test'
- name: Build and test with Rake
if: success()
working-directory: backend/ruby
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rspec ./spec
But it seems the postgresql connection is not found and my test fails. An error occurred while loading ./spec/controllers/admin/sessions_controller_spec.rb.
Failure/Error: ActiveRecord::Migration.maintain_test_schema!
PG::ConnectionBad:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
# ./spec/rails_helper.rb:29:in `<top (required)>'
# ./spec/controllers/admin/sessions_controller_spec.rb:3:in `require'
# ./spec/controllers/admin/sessions_controller_spec.rb:3:in `<top (required)>' |
@aruprakshit What does your connection string look like? I found I had to explicitly set a username/password in the job config when using a URL string: database.yml
my_action.yml
|
I'm using both user and password, and got this error:
Where is this
It fails in the |
Nevermind, I've just solved it. The problem was being caused by by the the NODE_ENV variable not being properly set, so the database's url wasn't been properly built in my config file. |
Hi, I was just wondering what hostname should I use to connect postgresql db in github envirnoment?
The text was updated successfully, but these errors were encountered: