version: '3.8'
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: promocrypt_test
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test"]
interval: 5s
timeout: 5s
retries: 5
test-linux:
build:
context: .
dockerfile: Dockerfile.linux-x86_64
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgres://test:test@postgres:5432/promocrypt_test
PROMOCRYPT_SECRET: test-secret-for-ci
volumes:
- ./test-results:/app/test-results
command: >
sh -c "
mkdir -p /app/test-results
cargo test --release -- --test-threads=1 2>&1 | tee /app/test-results/test-output.txt
cargo build --release
./target/release/promocrypt --version
./target/release/promocrypt doctor
"