Skip to content

chore: add docker-compose with SQS for local and CI tests #10

chore: add docker-compose with SQS for local and CI tests

chore: add docker-compose with SQS for local and CI tests #10

Workflow file for this run

name: Tests
on:
push:
branches: [main]
paths-ignore:
- "*.md"
- "docs/**"
pull_request:
branches: [main]
paths-ignore:
- "*.md"
- "docs/**"
permissions:
actions: read
contents: read
pull-requests: read
env:
AWS_DEFAULT_REGION: "us-east-1"
AWS_ENDPOINT_URL: "http://localhost:4566"
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test" # pragma: allowlist secret
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # eventually add `windows-latest` and `macos-latest`
python-version: ["3.10", "3.11", "3.12"]
services:
ministack:
image: ministackorg/ministack:1.3.53
ports:
- 4566:4566
env:
AWS_DEFAULT_REGION: us-east-1
GATEWAY_PORT: 4566
MINISTACK_ACCOUNT_ID: "000000000000"
MINISTACK_REGION: us-east-1
LOG_LEVEL: INFO
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: setup-uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
enable-cache: true
cache-suffix: ${{ matrix.python-version }}
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: uv sync --all-extras
- name: Wait for ministack
run: |
for i in {1..60}; do
if curl -fsS http://localhost:4566/_localstack/health >/dev/null; then
echo "ministack is up"
exit 0
fi
sleep 2
done
echo "ministack failed to start; dumping container logs:"
docker ps -a
docker logs "$(docker ps -aq --filter ancestor=ministackorg/ministack:1.3.53)" || true
exit 1
- name: Run tests
run: uv run pytest