Skip to content

Added unit test to workflow #194

Added unit test to workflow

Added unit test to workflow #194

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkoutcode
uses: actions/checkout@v3
- name: Build docker with new method
uses: isbang/[email protected]
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes"
services: |
elasticsearch
web
- name: Check the website status
run: |
ls -a
echo "Sleeping for 60 seconds"
sleep 45
docker ps -a
if curl -s http://localhost:5000/ | grep "Welcome!"
then
echo "Welcome message detected. PR can to merge!"
else
echo "Welcome message not detected. PR can't merge!"
exit 1
fi
- name: Check the unit tests status
run: |
echo "Running unit tests"
docker exec -i web-server bash -c "cd /tests && python -m pytest"