This commit is contained in:
+17
-11
@@ -17,17 +17,6 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: password
|
|
||||||
redis:
|
|
||||||
image: redis
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
@@ -49,10 +38,27 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TESTCONTAINERS_RYUK_DISABLED: "true"
|
TESTCONTAINERS_RYUK_DISABLED: "true"
|
||||||
run: |
|
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
|
./scripts/gen-it.sh
|
||||||
|
|
||||||
./mvnw -B verify \
|
./mvnw -B verify \
|
||||||
-Dquarkus.container-image.push=false \
|
-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
|
- name: Debug Quarkus Integration Test Logs
|
||||||
if: failure()
|
if: failure()
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ quarkus.datasource.db-kind=postgresql
|
|||||||
quarkus.datasource.username=postgres
|
quarkus.datasource.username=postgres
|
||||||
quarkus.datasource.password=password
|
quarkus.datasource.password=password
|
||||||
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
|
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
|
||||||
quarkus.test.container.network-mode=host
|
|
||||||
|
|
||||||
## Tự động tạo bảng từ Entity (chỉ dùng cho môi trường dev)
|
## Tự động tạo bảng từ Entity (chỉ dùng cho môi trường dev)
|
||||||
quarkus.hibernate-orm.database.generation=update
|
quarkus.hibernate-orm.database.generation=update
|
||||||
|
|||||||
Reference in New Issue
Block a user