Skip to content

Commit

Permalink
use compose file approach
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamman committed Sep 23, 2024
1 parent c11054e commit d182150
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 44 deletions.
67 changes: 23 additions & 44 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,36 @@
name: Test

on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, labeled]

push:
branches:
- main
- test/ci-with-minio
pull_request:

jobs:
minio-test:
runs-on: ubuntu-latest
services:
minio:
image: quay.io/minio/minio
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
options: >-
--health-cmd="curl --silent --fail http://localhost:9000/minio/health/live || exit 1"
--health-interval=5s
--health-timeout=10s
--health-retries=5
server /data
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ['3.11']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Wait for MinIO to be ready
- name: Standup MongoDB, MinIO and Arraylake API
run: |
for i in {1..10}; do
if curl --silent --fail http://localhost:9000/minio/health/live; then
break
fi
sleep 3
done
docker compose up -d minio
docker compose exec -T minio mc alias set minio http://minio:9000 minio123 minio123
- name: Install MinIO client (mc)
run: |
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin/
- name: Create test bucket
run: |
mc alias set minio http://localhost:9000 minioadmin minioadmin
mc mb minio/test-bucket
- name: Run tests
run: |
# Add commands to run your tests here
echo "Running tests against MinIO..."
# Example:
# pytest --minio-endpoint http://localhost:9000 --bucket test-bucket
- name: Use Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
25 changes: 25 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
volumes:
minio_data:

services:
minio:
container_name: minio
image: quay.io/minio/minio
entrypoint: |
/bin/sh -c '
for bucket in testbucket externalbucket arraylake-repo-bucket
do
echo creating bucket "$$bucket";
mkdir -p /data/"$$bucket"
done;
/usr/bin/minio server --console-address ":9001" /data
'
environment:
- MINIO_ROOT_USER=minio123
- MINIO_ROOT_PASSWORD=minio123
volumes:
- minio_data:/data
ports:
- '9000:9000'
- '9001:9001'

0 comments on commit d182150

Please sign in to comment.