Skip to content

fix: shut down the containers after running ci #110

fix: shut down the containers after running ci

fix: shut down the containers after running ci #110

Workflow file for this run

name: Run Tests for Backend
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout page source
uses: actions/checkout@v3
- name: Build the Docker image and run tests
run: docker compose -f "backend/compose.test.yaml" up -d
- name: Print Logs for Container
run: |
export CONTAINER_ID=$(docker ps -aqf "name=ci")
if docker logs $CONTAINER_ID | grep -i "FAILED"; then
echo "Test failed. Exiting with status code 1."
exit 1
else
echo "Test passed. Exiting with status code 0."
exit 0
fi
- name: Stop and remove the Docker container
run: docker compose -f "backend/compose.test.yaml" down