This commit is contained in:
+12
-26
@@ -17,8 +17,17 @@ permissions:
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_NET: "quarkus-it-net"
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
POSTGRES_PASSWORD: password
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
@@ -40,27 +49,10 @@ jobs:
|
||||
env:
|
||||
TESTCONTAINERS_RYUK_DISABLED: "true"
|
||||
run: |
|
||||
docker network create ${DOCKER_NET} || true
|
||||
|
||||
docker run -d --name postgres-it --network ${DOCKER_NET} -e POSTGRES_PASSWORD=password postgres || true
|
||||
docker run -d --name redis-it --network ${DOCKER_NET} redis || true
|
||||
|
||||
POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres-it)
|
||||
REDIS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis-it)
|
||||
|
||||
./scripts/gen-it.sh
|
||||
|
||||
./mvnw -B verify \
|
||||
-Dquarkus.container-image.push=false \
|
||||
-Dquarkus.test.container.network=${DOCKER_NET}
|
||||
-Dquarkus.datasource.jdbc.url=jdbc:postgresql://${POSTGRES_IP}:5432/postgres \
|
||||
-Dquarkus.redis.hosts=redis://${REDIS_IP}:6379
|
||||
|
||||
- name: Clean up Docker containers
|
||||
if: always()
|
||||
run: |
|
||||
docker ps -a --filter network=${DOCKER_NET} -q | xargs -r docker rm -f
|
||||
docker network rm ${DOCKER_NET}
|
||||
|
||||
- name: Debug Quarkus Integration Test Logs
|
||||
if: failure()
|
||||
@@ -73,10 +65,4 @@ jobs:
|
||||
docker ps -a
|
||||
|
||||
echo "--- DOCKER NETWORK INSPECT ---"
|
||||
docker network inspect ${DOCKER_NET} || true
|
||||
|
||||
- name: Test Summary
|
||||
uses: test-summary/action@v2
|
||||
with:
|
||||
paths: "**/TEST-*.xml"
|
||||
if: always()
|
||||
docker network inspect ${DOCKER_NET} || true
|
||||
Reference in New Issue
Block a user