-
-
Notifications
You must be signed in to change notification settings - Fork 9
112 lines (104 loc) · 3.26 KB
/
rust.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: tests
on:
pull_request:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
push:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
branches:
- main
- 0.*.x
- pr/**/ci
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Unit Test, Clippy & Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo fmt --all -- --check
- run: cargo build --all
- run: cargo test --all
- run: cargo test --package sea-streamer-stdio --test '*' --features test -- --nocapture
- run: cargo test --package sea-streamer-file --test '*' --features test,runtime-async-std -- --nocapture
- run: cargo test --package sea-streamer-file --test '*' --features test,runtime-tokio -- --nocapture
- run: cargo clippy --features file,redis,kafka,stdio,socket,json -- -D warnings
- run: cargo clippy --all
kafka:
name: Kafka
runs-on: ubuntu-latest
env:
HOST_ID: DUMMY_HOST_ID
RUST_LOG: rdkafka=trace
strategy:
fail-fast: false
matrix:
kafka_version: [3.3.1, 2.8]
runtime: [async-std, tokio]
services:
zookeeper:
image: bitnami/zookeeper:latest
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
kafka:
image: bitnami/kafka:${{ matrix.kafka_version }}
ports:
- 9092:9092
env:
KAFKA_BROKER_ID: 1
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --package sea-streamer-kafka --features test,runtime-${{ matrix.runtime }} -- --nocapture
redpanda:
name: Redpanda
runs-on: ubuntu-latest
env:
HOST_ID: DUMMY_HOST_ID
RUST_LOG: rdkafka=trace
strategy:
fail-fast: false
matrix:
redpanda_version: [latest]
runtime: [async-std, tokio]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: docker run -d -p 9092:9092 -p 9644:9644 redpandadata/redpanda:${{ matrix.redpanda_version }} redpanda start --overprovisioned --smp 1 --memory 1G --reserve-memory 0M --node-id 0 --check=false
- run: cargo test --package sea-streamer-kafka --features test,runtime-${{ matrix.runtime }} -- --nocapture
redis:
name: Redis
runs-on: ubuntu-latest
env:
HOST_ID: DUMMY_HOST_ID
strategy:
fail-fast: false
matrix:
redis_version: [latest]
runtime: [async-std, tokio]
services:
redis:
image: redis:${{ matrix.redis_version }}
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --package sea-streamer-redis --no-default-features --features test,runtime-${{ matrix.runtime }} -- --nocapture