【发布时间】:2021-04-04 09:58:48
【问题描述】:
我正在尝试基于this article 和this article 中显示的配置,使用 Postgresql 在 Github Actions 上构建和测试 Rails 应用程序。当我将分支推送到 Github 以启动操作时,运行测试时出现以下错误:
PG::ConnectionBad: fe_sendauth: 未提供密码
我提供了那些文章中显示的数据库的用户名和密码,为什么会失败?
[...]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
[...]
- name: Install postgres
run: sudo apt-get install libpq-dev
- name: Install dependencies
run: bundle install
- name: Setup database
env:
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
run: |
cp config/database.yml.github-actions config/database.yml
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
run: bundle exec rake
【问题讨论】:
标签: ruby-on-rails postgresql github-actions