Skip to content

Commit ca23a00

Browse files
committed
WIP
1 parent 7c690be commit ca23a00

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

.github/workflows/DockerFile

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
FROM python:3.13-alpine
22

33
# Runtime environment variables
4-
ENV DESC=""
5-
ENV SOURCE=""
4+
# ENV DESC=""
5+
# ENV SOURCE=""
66
ENV LOGFILE="/logs/logs.txt"
77
ENV DEPENDENCIES=""
88

9-
RUN mkdir -p /logs
109

11-
RUN echo "Setting up environment variables: DESC=$DESC, SOURCE=$SOURCE, LOGFILE=$LOGFILE, DEPENDENCIES=$DEPENDENCIES" >> $LOGFILE
1210

13-
# Install system dependencies
14-
RUN apk add --no-cache gcc musl-dev
11+
CMD sh -c 'echo "Run unit tests with coverage" >> $LOGFILE'
1512

16-
# Install Poetry
17-
RUN echo "Installing Poetry..." >> $LOGFILE
18-
RUN pip install poetry==1.8.4
13+
# RUN mkdir -p /logs
1914

20-
# Set workdir and copy dependency files first for caching
21-
RUN echo "Setting up work directory and copying dependency files..." >> $LOGFILE
22-
WORKDIR /app
23-
COPY pyproject.toml poetry.lock ./
24-
RUN poetry install --no-root
15+
# RUN echo "CWD: $(pwd)" >> $LOGFILE
16+
# RUN echo ">>>>>>>>>>>>> Setting up environment variables: DESC=$DESC, SOURCE=$SOURCE, LOGFILE=$LOGFILE, DEPENDENCIES=$DEPENDENCIES" >> $LOGFILE
2517

26-
# Copy the rest of the code
27-
COPY . .
18+
# # Install system dependencies
19+
# RUN apk add --no-cache gcc musl-dev
2820

29-
# Set PYTHONPATH for runtime
30-
ENV PYTHONPATH=$SOURCE/src:$SOURCE/tests
21+
# # Install Poetry
22+
# RUN echo ">>>>>>>>>>>>> Installing Poetry..." >> $LOGFILE
23+
# RUN pip install poetry==1.8.4
3124

32-
# Default command: install dependencies at runtime, then run tests
33-
CMD sh -c 'if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi && \
34-
echo "Run unit tests with coverage" >> $LOGFILE && \
35-
poetry run coverage run --source=$SOURCE -m unittest discover -s $SOURCE || echo "$DESC tests failed" >> /logs/failed_tests.txt && \
36-
poetry run coverage xml -o /logs/sonarcloud-coverage-$DESC.xml'
25+
# # Set workdir and copy dependency files first for caching
26+
# RUN echo ">>>>>>>>>>>>> Setting up work directory and copying dependency files..." >> $LOGFILE
27+
# WORKDIR /app
28+
# COPY pyproject.toml poetry.lock ./
29+
# RUN poetry install --no-root
30+
31+
# # Copy the rest of the code
32+
# COPY . .
33+
34+
# # Set PYTHONPATH for runtime
35+
# ENV PYTHONPATH=$SOURCE/src:$SOURCE/tests
36+
37+
# # Default command: install dependencies at runtime, then run tests
38+
# CMD sh -c 'if [ -n "$DEPENDENCIES" ]; then pip install $DEPENDENCIES; fi && \
39+
# echo "Run unit tests with coverage" >> $LOGFILE && \
40+
# poetry run coverage run --source=$SOURCE -m unittest discover -s $SOURCE || echo "$DESC tests failed" >> /logs/failed_tests.txt && \
41+
# poetry run coverage xml -o /logs/sonarcloud-coverage-$DESC.xml'

.github/workflows/run-docker.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ docker run --rm \
3131
-e DEPENDENCIES="$DEPENDENCIES" \
3232
-e SOURCE="$SOURCE" \
3333
-e DESC="$DESC" \
34+
-v $(pwd)/$SOURCE:/app \
3435
-v $(pwd)/logs:/logs \
3536
write-logs-image \
36-
sh -c "python3 -m unittest discover -s $SOURCE"
37+
sh -c 'echo "CWD: $(pwd)" > $LOGFILE && \
38+
ls -l /app >> $LOGFILE && \
39+
echo "DESC: \"$DESC\"" >> $LOGFILE && \
40+
echo "SOURCE: \"$SOURCE\"" >> $LOGFILE && \
41+
echo "DEPENDENCIES: \"$DEPENDENCIES\"" >> $LOGFILE && \
42+
echo "Running unit tests..." >> $LOGFILE && \
43+
pip install $DEPENDENCIES && \
44+
echo "Unit tests DONE" >> $LOGFILE '
45+
# python3 -m unittest discover -s $SOURCE'

0 commit comments

Comments
 (0)