Skip to content

Commit 0fe5ffe

Browse files
committed
ci: add docker build test
1 parent 730782e commit 0fe5ffe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ jobs:
3838
- name: Boot Unit Test with Gradle
3939
run: ./gradlew :boot:test
4040

41+
docker-build-test:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
- name: Build Docker image
47+
run: |
48+
docker build --build-arg ROUTE_ROOT_PATH=/memshell-party --build-arg CONTEXT_PATH=/memshell-party -t app .
49+
docker images
50+
- name: Run Docker container
51+
run: |
52+
docker run -d -e BOOT_OPTS=--server.servlet.context-path=/memshell-party -p 8080:8080 app
53+
sleep 10
54+
- name: Test with curl
55+
run: |
56+
if [[ $(curl -w "%{http_code}" -o /dev/null http://localhost:8080/memshell-party/version) -eq 200 ]]; then
57+
echo "Test successful!"
58+
else
59+
echo "Test failed!"
60+
exit 1
61+
fi
62+
4163
integration-test:
4264
strategy:
4365
fail-fast: false

0 commit comments

Comments
 (0)