Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb02c830

Browse files
oneslashjohnward
authored andcommitted
chore(actions): gh actions (#2)
* chore(actions): gh actions
1 parentc6fdbdc commitb02c830

File tree

9 files changed

+84
-34
lines changed

9 files changed

+84
-34
lines changed

‎.github/workflows/rust.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,54 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR:always
11+
RUST_TEST_THREADS:1
12+
DOCKER_HUB_USER:${{ secrets.DOCKER_HUB_USER }}
13+
DOCKER_HUB_TOKEN:${{ secrets.DOCKER_HUB_TOKEN }}
1114

1215
jobs:
13-
build:
14-
16+
test:
1517
runs-on:ubuntu-latest
16-
18+
strategy:
19+
matrix:
20+
include:
21+
-KAFKA_VER:3.0.0
22+
COMPRESSIONS:NONE
23+
SECURES:""
24+
-KAFKA_VER:3.0.0
25+
COMPRESSIONS:NONE
26+
SECURES:secure
27+
-KAFKA_VER:3.0.0
28+
COMPRESSIONS:SNAPPY
29+
SECURES:""
30+
-KAFKA_VER:3.0.0
31+
COMPRESSIONS:SNAPPY
32+
SECURES:secure
33+
-KAFKA_VER:3.0.0
34+
COMPRESSIONS:GZIP
35+
SECURES:""
36+
-KAFKA_VER:3.0.0
37+
COMPRESSIONS:GZIP
38+
SECURES:secure
1739
steps:
1840
-uses:actions/checkout@v4
41+
-name:Login to Docker Hub
42+
run:echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
43+
44+
-name:Set up Rust
45+
uses:actions-rs/toolchain@v1
46+
with:
47+
profile:minimal
48+
toolchain:stable
49+
1950
-name:Build
20-
run:cargo build --verbose
51+
run:cargo build
52+
2153
-name:Run tests
22-
run:cargo test --verbose
54+
run:./tests/run-all-tests ${{ matrix.KAFKA_VER }}
55+
env:
56+
KAFKA_VER:${{ matrix.KAFKA_VER }}
57+
COMPRESSIONS:${{ matrix.COMPRESSIONS }}
58+
SECURES:${{ matrix.SECURES }}
59+
60+
-name:Generate documentation
61+
run:cargo doc

‎.travis.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ script: |
2121
2222
jobs:
2323
include:
24-
# 0.8 doesn't support secure settings
25-
-env:KAFKA_VER=0.8.2.2 COMPRESSIONS=NONE SECURES=
26-
-env:KAFKA_VER=0.8.2.2 COMPRESSIONS=SNAPPY SECURES=
27-
-env:KAFKA_VER=0.8.2.2 COMPRESSIONS=GZIP SECURES=
28-
29-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=NONE SECURES=
30-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=NONE SECURES=secure
31-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=SNAPPY SECURES=
32-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=SNAPPY SECURES=secure
33-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=GZIP SECURES=
34-
-env:KAFKA_VER=0.9.0.1 COMPRESSIONS=GZIP SECURES=secure
35-
3624
-env:KAFKA_VER=0.10.2.1 COMPRESSIONS=NONE SECURES=
3725
-env:KAFKA_VER=0.10.2.1 COMPRESSIONS=NONE SECURES=secure
3826
-env:KAFKA_VER=0.10.2.1 COMPRESSIONS=SNAPPY SECURES=

‎tests/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
KAFKA_VER=1.0.0
2-
SCALA_VER=2.12
1+
KAFKA_VER=3.0.0
2+
SCALA_VER=2.13

‎tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
zookeeper:
3-
image:wurstmeister/zookeeper:3.4.6
3+
image:zookeeper:3.7.2
44
ports:
55
-"2181:2181"
66

‎tests/kafka-rust-image/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:xenial
1+
FROM ubuntu:latest
22

33
RUN apt-get update && apt-get install -y wget jq coreutils net-tools openjdk-8-jre
44

@@ -21,7 +21,7 @@ COPY start-kafka.sh /usr/bin/start-kafka.sh
2121
COPY create-topics.sh /usr/bin/create-topics.sh
2222

2323
ENV KAFKA_ZOOKEEPER_CONNECT zookeeper
24-
COPY server.properties secure.server.properties /opt/kafka/config/
24+
COPY server.properties secure.server.propertiesclient-ssl.properties/opt/kafka/config/
2525

2626
# set up an SSL certificate for secure mode
2727
RUN keytool \
@@ -34,6 +34,10 @@ RUN keytool \
3434
-storepass xxxxxx \
3535
-keypass xxxxxx
3636

37+
RUN keytool -exportcert -alias localhost -keystore /server.keystore.jks -file server-cert.pem -storepass xxxxxx -noprompt
38+
RUN keytool -importcert -file server-cert.pem -alias server-cert -keystore client.truststore.jks -storepass xxxxxx -noprompt
39+
RUN keytool -list -v -keystore client.truststore.jks -storepass xxxxxx -noprompt
40+
3741
EXPOSE 9092
3842

3943
# Use "exec" form so that it runs as PID 1 (useful for graceful shutdown)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
security.protocol=SSL
2+
ssl.enabled.protocols=TLSv1.2,TLSv1.3
3+
ssl.endpoint.identification.algorithm=
4+
ssl.truststore.location=/client.truststore.jks
5+
ssl.truststore.password=xxxxxx
6+
ssl.keystore.location=/client.truststore.jks
7+
ssl.keystore.password=xxxxxx
8+
ssl.key.password=xxxxxx
9+

‎tests/kafka-rust-image/create-topics.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3+
set -x
34

5+
SECURE_PARAM=""
46
if [[-z"$START_TIMEOUT" ]];then
57
START_TIMEOUT=600
68
fi
@@ -23,14 +25,22 @@ if $start_timeout_exceeded; then
2325
exit 1
2426
fi
2527

28+
if [[!-z"$KAFKA_CLIENT_SECURE" ]];then
29+
SECURE_PARAM_NAME="--command-config"
30+
SECURE_PARAM_VALUE="$KAFKA_HOME/config/client-ssl.properties"
31+
else
32+
SECURE_PARAM_NAME=""
33+
SECURE_PARAM_VALUE=""
34+
fi
35+
2636
if [[-n$KAFKA_CREATE_TOPICS ]];then
2737
IFS=',';fortopicToCreatein$KAFKA_CREATE_TOPICS;do
2838
echo"creating topics:$topicToCreate"
2939
IFS=':'read -a topicConfig<<<"$topicToCreate"
3040
if [${topicConfig[3]} ];then
31-
JMX_PORT=''$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper$KAFKA_ZOOKEEPER_CONNECT--replication-factor${topicConfig[2]} --partitions${topicConfig[1]} --topic"${topicConfig[0]}" --config cleanup.policy="${topicConfig[3]}"
41+
JMX_PORT=''$KAFKA_HOME/bin/kafka-topics.sh --create --bootstrap-server localhost:$KAFKA_PORT$SECURE_PARAM_NAME$SECURE_PARAM_VALUE--replication-factor${topicConfig[2]} --partitions${topicConfig[1]} --topic"${topicConfig[0]}" --config cleanup.policy="${topicConfig[3]}"
3242
else
33-
JMX_PORT=''$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper$KAFKA_ZOOKEEPER_CONNECT--replication-factor${topicConfig[2]} --partitions${topicConfig[1]} --topic"${topicConfig[0]}"
43+
JMX_PORT=''$KAFKA_HOME/bin/kafka-topics.sh --create --bootstrap-server localhost:$KAFKA_PORT$SECURE_PARAM_NAME$SECURE_PARAM_VALUE--replication-factor${topicConfig[2]} --partitions${topicConfig[1]} --topic"${topicConfig[0]}"
3444
fi
3545
done
3646
fi

‎tests/kafka-rust-image/start-kafka.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ if [[ -z "$KAFKA_PORT" ]]; then
44
export KAFKA_PORT=9092
55
fi
66

7+
8+
echo"Starting kafka server"
9+
710
create-topics.sh&
811

9-
if [[!-z"$KAFKA_CLIENT_SECURE" ]]&&!echo$KAFKA_VER| grep -P'^0.8';then
12+
if [[!-z"$KAFKA_CLIENT_SECURE" ]];then
1013
config_fname="$KAFKA_HOME/config/secure.server.properties"
1114
else
1215
config_fname="$KAFKA_HOME/config/server.properties"

‎tests/run-all-tests

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# `wurstmeister/kafka` repo. If there are no versions specified, it runs the tests
1919
# on a set of default versions.
2020

21-
set -e
21+
set -e -x
2222

2323
stop_docker() {
2424
docker compose down
@@ -31,8 +31,8 @@ start_docker() {
3131
docker compose up -d zookeeper kafka
3232

3333
# wait for Kafka to be ready and the test topic to be created
34-
./do_until_success"docker compose logs kafka | grep 'Created topic\"kafka-rust-test\"'"
35-
./do_until_success"docker compose logs kafka | grep 'Created topic\"kafka-rust-test2\"'"
34+
./do_until_success"docker compose logs kafka | grep 'Created topic kafka-rust-test'"
35+
./do_until_success"docker compose logs kafka | grep 'Created topic kafka-rust-test2'"
3636
}
3737

3838
setup() {
@@ -57,16 +57,13 @@ teardown() {
5757

5858
# need to run tests serially to avoid the tests stepping on each others' toes
5959
export RUST_TEST_THREADS=1
60-
DEFAULT_VERS='0.8.2.2:0.9.0.1:0.10.2.1:0.11.0.1:1.0.0:3.1.0'
60+
DEFAULT_VERS='3.0.0:3.1.0:3.2.0'
6161
DEFAULT_COMPRESSIONS='NONE:SNAPPY:GZIP'
6262
DEFAULT_SECURES=':secure'
6363

64-
declare SCALA_VERS_0_8_2_2='2.11'
65-
declare SCALA_VERS_0_9_0_1='2.11'
66-
declare SCALA_VERS_0_10_2_1='2.12'
67-
declare SCALA_VERS_0_11_0_1='2.12'
68-
declare SCALA_VERS_1_0_0='2.12'
64+
declare SCALA_VERS_3_0_0='2.13'
6965
declare SCALA_VERS_3_1_0='2.13'
66+
declare SCALA_VERS_3_0_0='2.13'
7067

7168
scala_version_for_kafka() {
7269
local kv=$(echo$1| sed's/\./_/g')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp