Skip to content

Commit 6a22248

Browse files
committed
wip4
1 parent 8fdd8c8 commit 6a22248

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/docker-build.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,38 @@ jobs:
106106
run: |
107107
IMAGE_TAG="${{ needs.build.outputs.image_digest }}"
108108
109-
# Run the container with test environment
109+
# Create a Docker volume for test results
110+
docker volume create cws-test-results
111+
112+
# Run the container with test environment and mount the repository
110113
docker run --name cws-test -d \
111114
-e DB_HOST=mock-db \
112115
-e DB_USER=mockuser \
113116
-e DB_PW=mockpw \
114117
-e ES_PROTOCOL=http \
115118
-e ES_HOST=mock-es \
116119
-e ES_PORT=9200 \
117-
${IMAGE_TAG}
120+
-e JAVA_HOME=/usr/lib/jvm/java-openjdk \
121+
-v ${PWD}:/workspace \
122+
-w /workspace \
123+
${IMAGE_TAG} tail -f /dev/null
118124
119125
# Check if container is running
120126
docker ps
121127
122-
# Run some basic verification tests
123-
echo "Checking container logs"
124-
docker logs cws-test
125-
126-
# Verify the Java version in the container
128+
# Verify Java setup in the container
127129
docker exec cws-test java -version
130+
docker exec cws-test echo "JAVA_HOME=$JAVA_HOME"
131+
132+
# Install Maven in the container
133+
docker exec cws-test yum install -y maven
134+
135+
# Run the tests
136+
docker exec cws-test ./test.sh
128137
129-
# More test commands can be added here
138+
# Copy test results if needed
139+
mkdir -p ./test-results
140+
docker cp cws-test:/workspace/target/site/jacoco-aggregate ./test-results/
130141
131142
- name: Clean up
132143
run: |

0 commit comments

Comments
 (0)