Skip to content

Update benchmark_requests.py #367

Update benchmark_requests.py

Update benchmark_requests.py #367

Workflow file for this run

name: Docker Image Build
on:
push:
branches-ignore:
- main
- dev
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get short commit hash
id: vars
run: echo "tag=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build the Docker image
run: docker build . --tag pesu-auth
- name: Spawn a container
run: docker run --name pesu-auth -d -p 5000:5000 pesu-auth
- name: Wait for the container to be ready
run: sleep 5
- name: Test container HTTP response
run: |
RESPONSE=$(curl --fail --max-time 10 http://localhost:5000 || echo "fail")
if [ "$RESPONSE" = "fail" ]; then
echo "❌ Container did not respond."
docker logs pesu-auth
exit 1
fi
echo "✅ Container is responsive."
- name: Stop the container
run: |
docker stop pesu-auth