Skip to content

Commit

Permalink
Add postgres service
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwarda committed Feb 17, 2024
1 parent f0d92c6 commit 53de52d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
concurrency: deploy-group

services:
postgres:
image: ankane/pgvector:latest
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
Expand All @@ -23,3 +37,6 @@ jobs:
elixir-version: '1.16.1'
- run: mix deps.get
- run: mix test
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
4 changes: 2 additions & 2 deletions apps/api/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ config :bcrypt_elixir, :log_rounds, 1
config :buildel, Buildel.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
hostname: System.get_env("POSTGRES_HOST", "localhost"),
database: "buildel_test#{System.get_env("MIX_TEST_PARTITION")}",
port: 54321,
port: System.get_env("POSTGRES_PORT", 54321),
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ defmodule BuildelWeb.UserController do
action_fallback(BuildelWeb.FallbackController)

plug(:fetch_current_user)

plug(:require_authenticated_user)

def me(conn, _params) do
Expand Down

0 comments on commit 53de52d

Please sign in to comment.