Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
simao committed Oct 4, 2023
1 parent f10287e commit c8381be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"

Expand All @@ -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
2 changes: 1 addition & 1 deletion libats-messaging/build.sbt
Original file line number Diff line number Diff line change
@@ -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"
)

0 comments on commit c8381be

Please sign in to comment.