Skip to content

Commit

Permalink
fix: shut down the containers after running ci
Browse files Browse the repository at this point in the history
  • Loading branch information
arteevraina committed Dec 15, 2023
1 parent 01f8a04 commit 6293138
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ name: Run Tests for Backend

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout page source
uses: actions/checkout@v3
- 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: 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")
`docker logs -f $CONTAINER_ID` | grep -i "FAILED" && exit 1 || exit 0
- name: Print Logs for Container
run: |
export CONTAINER_ID=$(docker ps -aqf "name=ci")
docker logs -f $CONTAINER_ID | grep -i "FAILED" && exit 1 || exit 0
- name: Stop and remove the Docker container
run: docker compose -f "backend/compose.test.yaml" down

0 comments on commit 6293138

Please sign in to comment.