Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,27 @@ jobs:
- run: PYTHONPATH=sdks/python/src python -m unittest discover -s sdks/python/tests -v
- name: Rust SDK
run: cargo test --locked --manifest-path sdks/rust/Cargo.toml
- name: Validate and build containers
- name: Validate containers and start with a fresh database
env:
ADMIN_PASSWORD: ci-admin-password-not-for-production
CONTROL_PLANE_SECRET: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
POSTGRES_PASSWORD: 0123456789abcdef0123456789abcdef
GATEWAY_API_KEY: pf_0123456789abcdef0123456789abcdef0123456789abcdef
run: docker compose config --quiet && docker compose build
run: |
docker compose config --quiet
cleanup() {
compose_exit_status=$?
if [ "$compose_exit_status" -ne 0 ]; then
docker compose logs --no-color || true
fi
docker compose down --volumes || compose_exit_status=$?
exit "$compose_exit_status"
}
trap cleanup EXIT
docker compose up --build --wait --wait-timeout 120
curl --fail --silent --show-error http://127.0.0.1:8080/v1/health > /dev/null
curl --fail --silent --show-error http://127.0.0.1:8081/health > /dev/null
curl --fail --silent --show-error --retry 10 --retry-connrefused --retry-delay 1 http://127.0.0.1:3000/ > /dev/null
for container in $(docker compose ps -q); do
test "$(docker inspect --format '{{.RestartCount}}' "$container")" -eq 0
done
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ services:
ports:
- "127.0.0.1:55432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pyro -d pyro"]
# The temporary initialization server only accepts Unix-socket connections.
test: ["CMD", "pg_isready", "-h", "127.0.0.1", "-U", "pyro", "-d", "pyro"]
interval: 5s
timeout: 3s
retries: 20
Expand All @@ -35,6 +36,9 @@ services:
GATEWAY_API_KEY: ${GATEWAY_API_KEY:?Set GATEWAY_API_KEY in .env}
ports:
- "127.0.0.1:8080:8080"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/v1/health"]
interval: 5s
Expand All @@ -60,6 +64,8 @@ services:
ports:
- "127.0.0.1:8081:8081"
depends_on:
postgres:
condition: service_healthy
gateway:
condition: service_healthy
healthcheck:
Expand Down
Loading