diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07738b04..ef8fe4e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,23 +57,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: Run Zookeeper and Kafka - run: | - docker run \ - --name sentry_zookeeper \ - -d --network host \ - -e ZOOKEEPER_CLIENT_PORT=2181 \ - confluentinc/cp-zookeeper:6.2.0 - - docker run \ - --name sentry_kafka \ - -d --network host \ - -e KAFKA_ZOOKEEPER_CONNECT=127.0.0.1:2181 \ - -e KAFKA_LISTENERS=INTERNAL://0.0.0.0:9093,EXTERNAL://0.0.0.0:9092 \ - -e KAFKA_ADVERTISED_LISTENERS=INTERNAL://127.0.0.1:9093,EXTERNAL://127.0.0.1:9092 \ - -e KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT \ - -e KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL \ - -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \ - confluentinc/cp-kafka:6.2.0 + run: sh scripts/run-kafka.sh - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 5fc6cde3..be2b8d5c 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -26,5 +26,7 @@ jobs: steps: - uses: actions/checkout@v3 name: Checkout code + - name: Run Zookeeper and Kafka + run: sh scripts/run-kafka.sh - name: Run tests run: cd rust-arroyo && cargo test diff --git a/scripts/run-kafka.sh b/scripts/run-kafka.sh new file mode 100644 index 00000000..f22d0fec --- /dev/null +++ b/scripts/run-kafka.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +docker run \ + --name sentry_zookeeper \ + -d --network host \ + -e ZOOKEEPER_CLIENT_PORT=2181 \ + confluentinc/cp-zookeeper:6.2.0 + +docker run \ + --name sentry_kafka \ + -d --network host \ + -e KAFKA_ZOOKEEPER_CONNECT=127.0.0.1:2181 \ + -e KAFKA_LISTENERS=INTERNAL://0.0.0.0:9093,EXTERNAL://0.0.0.0:9092 \ + -e KAFKA_ADVERTISED_LISTENERS=INTERNAL://127.0.0.1:9093,EXTERNAL://127.0.0.1:9092 \ + -e KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT \ + -e KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL \ + -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \ + confluentinc/cp-kafka:6.2.0