Update benchmark_requests.py #367
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |