mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Add Postgres info to README
This commit is contained in:
@@ -91,6 +91,35 @@ jobs:
|
|||||||
- run: mix test
|
- run: mix test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Authenticating with Postgres in Phoenix
|
||||||
|
|
||||||
|
When using the Phoenix example above, the `postgres` container has some
|
||||||
|
default authentication set up. Specifically, it expects a username of
|
||||||
|
"postgres", and a password of "postgres". It will be available at
|
||||||
|
`localhost:5432`.
|
||||||
|
|
||||||
|
The simplest way of setting these auth values in CI is by checking for the
|
||||||
|
`GITHUB_ACTIONS` environment variable that is set in all workflows:
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
# config/test.exs
|
||||||
|
|
||||||
|
use Mix.Config
|
||||||
|
|
||||||
|
# Configure the database for local testing
|
||||||
|
config :app, App.Repo,
|
||||||
|
database: "my_app_test",
|
||||||
|
hostname: "localhost",
|
||||||
|
pool: Ecto.Adapters.SQL.Sandbox
|
||||||
|
|
||||||
|
# Configure the database for GitHub Actions
|
||||||
|
if System.get_env("GITHUB_ACTIONS") do
|
||||||
|
config :app, App.Repo,
|
||||||
|
username: "postgres",
|
||||||
|
password: "postgres"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT license](LICENSE.md).
|
The scripts and documentation in this project are released under the [MIT license](LICENSE.md).
|
||||||
|
|||||||
Reference in New Issue
Block a user