-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (41 loc) · 2.02 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Tests
on:
push:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
services:
broker:
image: apache/kafka:latest
ports:
- 9092:9092
options: >
--env KAFKA_NODE_ID=1
--env KAFKA_PROCESS_ROLES=broker,controller
--env KAFKA_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
--env KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
--env KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
--env KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
--env KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:9093
--env KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
--env KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
--env KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1
--env KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
--env KAFKA_NUM_PARTITIONS=3
steps:
- name: Create topics
run: |
docker exec ${{ job.services.broker.id }} /opt/kafka/bin/kafka-topics.sh --create --topic topic-one --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3;
docker exec ${{ job.services.broker.id }} /opt/kafka/bin/kafka-topics.sh --create --topic topic-two --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1;
docker exec ${{ job.services.broker.id }} /opt/kafka/bin/kafka-topics.sh --create --topic topic-three --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1;
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Run tests
run: cargo test --verbose