Skip to content

Add BattleEngine in Rust for better memory efficiency with large battles #870

Add BattleEngine in Rust for better memory efficiency with large battles

Add BattleEngine in Rust for better memory efficiency with large battles #870

name: Docker Compose Production Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test-docker:
runs-on: ubuntu-latest
services:
docker:
image: docker:26.0.0
options: --privileged
steps:
- uses: actions/checkout@v2
- name: Modify Dockerfile to disable USER www (which is not supported by GitHub Actions, as it runs as root)
run: |
sed -i '/USER www/s/^/#/' ./Dockerfile
- name: Set Permissions
run: sudo chmod -R 777 /var/www
- name: Copy .env
run: sudo cp .env.example-prod .env
- name: Build and start the services
run: |
# Build the images and start the services
docker compose -f docker-compose.prod.yml up -d
- name: Test if the services are running
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: |
sleep 15
# Array of endpoints to test
declare -A endpoints=(
["Web"]="https://localhost:443/login"
)
failed=false
# Test HTTP endpoints
for name in "${!endpoints[@]}"; do
url="${endpoints[$name]}"
echo "Testing $name at $url"
# Store both response body and HTTP code
response=$(curl -k -s -w "\nHTTP_CODE=%{http_code}" "$url")
http_code=$(echo "$response" | grep "HTTP_CODE=" | cut -d= -f2)
body=$(echo "$response" | sed '$d') # Remove the last line (HTTP_CODE)
if [ "$http_code" -ne 200 ]; then
echo "❌ $name failed with HTTP $http_code at $url"
echo "Response body:"
echo "$body"
failed=true
else
echo "✅ $name responded with HTTP 200"
fi
done
# Exit with error if any service failed
if [ "$failed" = true ]; then
# Get container logs
echo "Container Logs ogamex-app:"
docker compose logs ogamex-app
echo "Container Logs ogamex-db:"
docker compose logs ogamex-db
echo "Container Logs ogamex-webserver:"
docker compose logs ogamex-webserver
echo "Container Logs ogamex-scheduler:"
docker compose logs ogamex-scheduler
# Restart containers for next test in case of failure
docker compose restart
exit 1
fi