Skip to content

Commit d28fb32

Browse files
committed
ci: add S3 integration test job with MinIO and path filtering
1 parent 126ad26 commit d28fb32

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/rust.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,63 @@ jobs:
107107
env:
108108
RUSTDOCFLAGS: "-D warnings"
109109
run: cargo doc --no-deps --workspace
110+
111+
# S3 integration tests using MinIO (only when S3-related files change)
112+
test-s3-integration:
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v6
116+
117+
- name: Check for S3-related changes
118+
uses: dorny/paths-filter@v3
119+
id: changes
120+
with:
121+
filters: |
122+
s3:
123+
- 'spatialbench-cli/src/s3_writer.rs'
124+
- 'spatialbench-cli/src/runner.rs'
125+
- 'spatialbench-cli/src/output_plan.rs'
126+
- 'spatialbench-cli/src/main.rs'
127+
- 'spatialbench-cli/tests/s3_integration.rs'
128+
- '.github/workflows/rust.yml'
129+
130+
- name: Start MinIO
131+
if: steps.changes.outputs.s3 == 'true'
132+
run: |
133+
docker run -d --name minio \
134+
-p 9000:9000 \
135+
-e MINIO_ROOT_USER=minioadmin \
136+
-e MINIO_ROOT_PASSWORD=minioadmin \
137+
bitnami/minio:latest
138+
# Wait for MinIO to be ready
139+
for i in $(seq 1 30); do
140+
curl -sf http://localhost:9000/minio/health/live && break
141+
sleep 1
142+
done
143+
144+
- name: Create MinIO test bucket
145+
if: steps.changes.outputs.s3 == 'true'
146+
run: |
147+
curl -sL https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
148+
chmod +x /usr/local/bin/mc
149+
mc alias set local http://localhost:9000 minioadmin minioadmin
150+
mc mb local/spatialbench-test
151+
152+
- uses: dtolnay/rust-toolchain@stable
153+
if: steps.changes.outputs.s3 == 'true'
154+
155+
- uses: Swatinem/rust-cache@v2
156+
if: steps.changes.outputs.s3 == 'true'
157+
with:
158+
prefix-key: "rust-test-s3-v1"
159+
160+
- name: Run S3 integration tests
161+
if: steps.changes.outputs.s3 == 'true'
162+
env:
163+
AWS_ACCESS_KEY_ID: minioadmin
164+
AWS_SECRET_ACCESS_KEY: minioadmin
165+
AWS_ENDPOINT: http://localhost:9000
166+
AWS_REGION: us-east-1
167+
AWS_ALLOW_HTTP: "true"
168+
S3_TEST_BUCKET: spatialbench-test
169+
run: cargo test -p spatialbench-cli --test s3_integration -- --ignored

0 commit comments

Comments
 (0)