diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c54f2de..0e0a5ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,16 +3,13 @@ on: [push, pull_request] env: SBT_OPTS: "-Dsbt.color=true -Dscala.color=true" KAFKA_HOST: kafka:9092 - KAFKA_ZOOKEEPER_CONNECT: kafka:2181 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 jobs: run-tests: name: Run tests runs-on: ubuntu-latest container: uptane/ci:jvm17-latest services: - kafka: - image: spotify/kafka - db: image: mariadb:10.4 env: @@ -21,6 +18,34 @@ jobs: MYSQL_PASSWORD: libats MYSQL_DATABASE: libats + zookeeper: + image: bitnami/zookeeper:3.8.1 + ports: + - 2181:2181 + env: + ALLOW_ANONYMOUS_LOGIN: yes + options: >- + --health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + kafka: + image: bitnami/kafka:2.8.1 + ports: + - 9092:9092 + options: >- + --health-cmd "kafka-broker-api-versions.sh --version" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 + ALLOW_PLAINTEXT_LISTENER: yes + KAFKA_CFG_LISTENERS: PLAINTEXT://:9092 + KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_ENABLE_KRAFT: "no" + env: DB_URL: "jdbc:mariadb://db:3306/libats" @@ -30,4 +55,4 @@ jobs: uses: coursier/cache-action@v6 - run: until mysqladmin ping --protocol=TCP -h db -P 3306 -u root -proot; do echo waiting for mysql; sleep 1; done - run: mysql --protocol=TCP --host=db --user=root --port 3306 -proot -e \ GRANT\ ALL\ PRIVILEGES\ ON\ \`libats%\`.\*\ TO\ \'libats\'@\'%\'\; - - run: sbt test + - run: sbt libats_messaging/test diff --git a/libats-messaging/build.sbt b/libats-messaging/build.sbt index b7f5edaf..69cac6f7 100644 --- a/libats-messaging/build.sbt +++ b/libats-messaging/build.sbt @@ -1,5 +1,5 @@ name := "libats-messaging" libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-stream-kafka" % "2.1.1" + "com.typesafe.akka" %% "akka-stream-kafka" % "3.0.1" )