From ade97e71a0042a5bec8b6cb5268c91d0ff22681b Mon Sep 17 00:00:00 2001 From: meloian Date: Tue, 30 Apr 2024 19:31:24 +0300 Subject: [PATCH] update Docker and GitHub Actions setup for lab5 requirements --- .github/workflows/docker-build.yml | 12 +++++++++--- Dockerfile | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b22191d..f915676 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,4 +1,4 @@ -name: Docker Build +name: Docker Build and Test on: [push, pull_request] @@ -15,5 +15,11 @@ jobs: - name: Build Docker image run: docker build . -t my-application - - name: Run Docker container - run: docker run --rm my-application \ No newline at end of file + - name: Push to Docker Registry + run: docker push my-application:latest + + - name: Pull and Run Docker container + run: docker run --rm my-application + + - name: Execute Tests + run: docker run --rm my-application python3 -m unittest discover -s /app -p 'test_*.py' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d58bdda..7ffc745 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ COPY lab3 /app/lab3 ENV NAME World -CMD ["python3", "-m", "unittest", "discover", "-s", "/app/lab1", "-p", "test_*.py"] \ No newline at end of file +CMD ["python3", "-m", "unittest", "discover", "-s", "/app", "-p", "test_*.py"] \ No newline at end of file