new splits #1
This file contains 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 Compose Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Compose | |
run: docker compose up -d | |
working-directory: ./CompUGE-Backend | |
- name: Wait for the backend to be ready | |
run: sleep 60 | |
- name: Test the FastAPI app | |
run: | | |
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:15564/api/ping) | |
echo "Response code: $RESPONSE" | |
if [ "$RESPONSE" == "200" ]; then | |
echo "Ping test passed"; | |
else | |
echo "Ping test failed"; | |
exit 1; | |
fi | |
- name: Get backend service logs | |
if: failure() | |
run: docker compose logs backend | |
working-directory: ./CompUGE-Backend | |
- name: Get db service logs | |
if: failure() | |
run: docker compose logs db | |
working-directory: ./CompUGE-Backend | |
- name: Stop and remove Docker Compose services | |
run: docker compose down | |
working-directory: ./CompUGE-Backend | |