pulsar integration #40
Workflow file for this run
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: Test Suite | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper | |
ports: | |
- 32181:32181 | |
env: | |
ZOOKEEPER_CLIENT_PORT: 32181 | |
ALLOW_ANONYMOUS_LOGIN: yes | |
options: --hostname zookeeper | |
kafka: | |
image: confluentinc/cp-kafka | |
ports: | |
- 9092:9092 | |
- 29092:29092 | |
env: | |
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:32181" | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT" | |
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT_HOST://localhost:29092,PLAINTEXT://localhost:9092" | |
KAFKA_BROKER_ID: 1 | |
ALLOW_PLAINTEXT_LISTENER: yes | |
options: --hostname kafka | |
redis: | |
image: redis:alpine | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_DB: broadcaster | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: "actions/checkout@v2" | |
- uses: "actions/setup-python@v2" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
# Install Docker Compose if it's not available by default | |
- name: Set up Docker Compose | |
run: sudo apt-get install docker-compose -y | |
# Start Pulsar using Docker Compose | |
- name: Start Pulsar | |
run: docker-compose up -d pulsar | |
- name: Wait for Pulsar | |
run: | | |
timeout 300 bash -c ' | |
until curl -s http://localhost:8080/admin/v2/brokers/healthcheck; do | |
echo "Waiting for Pulsar to be ready..." | |
sleep 5 | |
done | |
echo "pulsar is ready" | |
' | |
- name: "Install dependencies" | |
run: "scripts/install" | |
# - name: "Run linting checks" | |
# run: "scripts/check" | |
- name: "Build package & docs" | |
run: "scripts/build" | |
- name: "Run tests" | |
run: "scripts/test" | |
- name: "Enforce coverage" | |
run: "scripts/coverage" | |
# Stop the Pulsar container after all tests are complete | |
- name: Stop Pulsar | |
run: docker-compose down |