diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7a0fb4ee27..8f5c4b1f20 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -14,21 +14,15 @@ jobs: test: runs-on: ubuntu-latest - services: - docker: - image: docker:19.03.12 - options: --privileged - ports: - - 8080:8080 - volumes: - - /var/run/docker.sock:/var/run/docker.sock - steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Docker Compose - run: sudo apt-get update && sudo apt-get install docker-compose -y + - name: Set up Docker + run: | + # Install Docker and Docker Compose + sudo apt-get update + sudo apt-get install -y docker.io docker-compose - name: Create Environment Files run: | @@ -52,14 +46,25 @@ jobs: - name: Clean up environment files run: | - rm ./frontend/.env - rm ./question-service/.env - rm ./user-service/.env + rm ./apps/frontend/.env + rm ./apps/question-service/.env + rm ./apps/user-service/.env - name: Wait for services to be ready - run: sleep 10 # this is the estimated service startup time + run: sleep 10 - name: Run Tests run: | - curl --fail http://localhost:3000 + # check if non-error status code received + curl --fail ${{ env.FRONTEND_URL }} + curl --fail ${{ env.USER_SERVICE_URL }} + + # check if any response received + curl -s -o /dev/null ${{ env.QUESTION_SERVICE_URL }} + # We can add more tests here + + - name: Stop Services + run: | + cd .apps + docker-compose down