File tree 1 file changed +19
-8
lines changed
1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -106,27 +106,38 @@ jobs:
106
106
run : |
107
107
IMAGE_TAG="${{ needs.build.outputs.image_digest }}"
108
108
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
110
113
docker run --name cws-test -d \
111
114
-e DB_HOST=mock-db \
112
115
-e DB_USER=mockuser \
113
116
-e DB_PW=mockpw \
114
117
-e ES_PROTOCOL=http \
115
118
-e ES_HOST=mock-es \
116
119
-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
118
124
119
125
# Check if container is running
120
126
docker ps
121
127
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
127
129
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
128
137
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/
130
141
131
142
- name : Clean up
132
143
run : |
You can’t perform that action at this time.
0 commit comments