Update pyproject.toml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python 3.10 test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
services: | |
rabbitmq: | |
image: rabbitmq:3.13.7 | |
env: | |
RABBITMQ_DEFAULT_USER: guest | |
RABBITMQ_DEFAULT_PASS: guest | |
ports: | |
- 5672:5672 | |
options: >- | |
--health-cmd "rabbitmqctl node_health_check" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . pytest pytest_asyncio | |
- name: Wait for RabbitMQ to be ready | |
run: | | |
for i in {1..60}; do | |
if nc -z localhost 5672; then | |
echo "RabbitMQ is up and running!" | |
break | |
fi | |
echo "Waiting for RabbitMQ... (Attempt $i/60)" | |
sleep 2 | |
done | |
- name: Run tests | |
run: | | |
pytest -s |