Skip to content

Commit

Permalink
separate Docker setup and workflow for lab4
Browse files Browse the repository at this point in the history
  • Loading branch information
meloian committed Apr 30, 2024
1 parent 980bd3e commit fc7d741
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lad4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lab 4 Build and Test

on:
push:
paths:
- 'lab4/**'
pull_request:
paths:
- 'lab4/**'

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image for Lab 4
run: docker build ./lab4 -t lab4-application

- name: Run Docker container
run: docker run --rm lab4-application
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@ COPY requirements.txt /app/

RUN pip install --no-cache-dir -r requirements.txt

COPY lab4/include /app/lab4/include
COPY lab4/src /app/lab4/src
COPY lab4/tests /app/lab4/tests
COPY lab4/Makefile /app/lab4/

COPY lab1 /app/lab1
COPY lab2 /app/lab2
COPY lab3 /app/lab3

RUN cd /app/lab4 && make all

ENV NAME World

CMD ["python3", "-m", "unittest", "discover", "-s", "/app/lab1", "-p", "test_*.py"]
CMD ["python3", "-m", "unittest", "discover", "-s", "/app/lab1", "-p", "test_*.py"]
14 changes: 14 additions & 0 deletions lab4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:latest

RUN apt-get update && apt-get install -y gcc make

WORKDIR /lab4

COPY src /lab4/src
COPY include /lab4/include
COPY tests /lab4/tests
COPY Makefile /lab4/

RUN make all

CMD ["./test"]

0 comments on commit fc7d741

Please sign in to comment.