Updated Tests #123
Workflow file for this run
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 Build Test | |
on: | |
pull_request: | |
paths: | |
- "**.py" | |
- "Dockerfile" | |
- "run.sh" | |
- "requirements.txt" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Build Docker Image" | |
run: | | |
docker build -t labconnect-backend . | |
- name: "Run Docker Container" | |
run: | | |
docker run -d --name labconnect-backend-container labconnect-backend | |
sleep 60 | |
docker logs labconnect-backend-container | |
docker stop labconnect-backend-container | |
- name: "Check for Container Exit Code" | |
run: | | |
docker inspect labconnect-backend-container --format='{{.State.ExitCode}}' | |
docker rm labconnect-backend-container | |
id: exit_code | |
- name: "Fail if Container Fails" | |
if: steps.exit_code.outputs.exit_code != '0' | |
run: exit 1 |