Skip to content

Commit bbb91d8

Browse files
committed
ci: test docker container
1 parent 64b1db8 commit bbb91d8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ jobs:
5959
--health-interval=10s
6060
--health-timeout=5s
6161
--health-retries=5
62+
minio:
63+
image: minio/minio
64+
ports:
65+
- 9090:9090
66+
options: >-
67+
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
68+
--health-interval 5s
69+
--health-timeout 5s
70+
--health-retries 5
71+
env:
72+
MINIO_ACCESS_KEY: minioadmin
73+
MINIO_SECRET_KEY: minioadmin
74+
MINIO_DEFAULT_BUCKETS: backups
6275
steps:
6376
- name: Checkout repository
6477
uses: actions/checkout@v4
@@ -189,7 +202,23 @@ jobs:
189202
-e TARGET_DB_PASSWORD=password \
190203
${{ env.IMAGE_NAME }}:latest migrate
191204
echo "Test migrate database testdb -> testdb3 completed"
192-
205+
- name: Test backup Minio (s3)
206+
run: |
207+
docker run --rm --name ${{ env.IMAGE_NAME }} \
208+
-v ./migrations:/backup/ \
209+
--network host \
210+
-e DB_HOST=127.0.0.1 \
211+
-e DB_USERNAME=user \
212+
-e DB_PASSWORD=password \
213+
-e DB_NAME=testdb \
214+
-e AWS_S3_ENDPOINT=http://127.0.0.1:9000 \
215+
-e AWS_S3_BUCKET_NAME=backups \
216+
-e AWS_ACCESS_KEY=minioadmin \
217+
-e AWS_SECRET_KEY=minioadmin \
218+
-e AWS_DISABLE_SSL=true \
219+
-e AWS_FORCE_PATH_STYLE=true \
220+
${{ env.IMAGE_NAME }}:latest backup -s s3
221+
echo "Test backup Minio (s3) completed"
193222
- name: Test backup all databases
194223
run: |
195224
docker run --rm --name ${{ env.IMAGE_NAME }} \

0 commit comments

Comments
 (0)