1
+ ---
1
2
name : Ensure parseable builds on all release targets
2
-
3
3
on :
4
4
pull_request :
5
5
paths-ignore :
6
- - " docs/**"
7
- - " helm/**"
8
- - " assets/**"
6
+ - docs/**
7
+ - helm/**
8
+ - assets/**
9
9
- " **.md"
10
-
11
10
jobs :
12
11
# Default build without Kafka
13
12
build-default :
@@ -30,15 +29,12 @@ jobs:
30
29
# Windows build
31
30
- os : windows-latest
32
31
target : x86_64-pc-windows-msvc
33
-
34
32
steps :
35
33
- uses : actions/checkout@v4
36
-
37
34
- name : Setup Rust toolchain
38
35
uses : dtolnay/rust-toolchain@stable
39
36
with :
40
37
targets : ${{ matrix.target }}
41
-
42
38
- name : Cache dependencies
43
39
uses : actions/cache@v4
44
40
with :
@@ -47,14 +43,12 @@ jobs:
47
43
~/.cargo/git
48
44
target
49
45
key : ${{ runner.os }}-cargo-${{ matrix.target }}-default-${{ hashFiles('**/Cargo.lock') }}
50
-
51
46
- name : Build
52
47
uses : actions-rs/cargo@v1
53
48
with :
54
49
use-cross : ${{ runner.os == 'Linux' }}
55
50
command : build
56
51
args : --target ${{ matrix.target }} --release
57
-
58
52
# Kafka build for supported platforms
59
53
build-kafka :
60
54
name : Build Kafka ${{matrix.target}}
68
62
target : x86_64-unknown-linux-gnu
69
63
- os : macos-latest
70
64
target : aarch64-apple-darwin
71
-
72
65
steps :
73
66
- uses : actions/checkout@v4
74
-
75
67
# Linux-specific dependencies
76
68
- name : Install Linux dependencies
77
69
if : runner.os == 'Linux'
90
82
python3 \
91
83
gcc-aarch64-linux-gnu \
92
84
g++-aarch64-linux-gnu
93
-
94
85
# Install cross-compilation specific packages
95
86
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
96
87
sudo apt-get install -y \
101
92
libssl-dev:arm64 \
102
93
pkg-config-aarch64-linux-gnu
103
94
fi
104
-
105
95
# macOS-specific dependencies
106
96
- name : Install macOS dependencies
107
97
if : runner.os == 'macOS'
@@ -115,67 +105,52 @@ jobs:
115
105
116
106
cyrus-sasl \
117
107
python3
118
-
119
108
- name : Setup Rust toolchain
120
109
uses : dtolnay/rust-toolchain@stable
121
110
with :
122
111
targets : ${{ matrix.target }}
123
-
124
112
- name : Cache dependencies
125
113
uses : actions/cache@v4
126
114
with :
127
115
path : |
128
116
~/.cargo/registry
129
117
~/.cargo/git
130
118
target
131
- key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{ hashFiles('**/Cargo.lock') }}
132
-
133
- - name : Build with Kafka
134
- uses : actions-rs/cargo@v1
135
- with :
136
- use-cross : ${{ runner.os == 'Linux' }}
137
- command : build
138
- args : --target ${{ matrix.target }} --features kafka --release
139
- env :
140
- LIBRDKAFKA_SSL_VENDORED : 1
141
- PKG_CONFIG_ALLOW_CROSS : " 1"
142
- PKG_CONFIG_PATH : " /usr/lib/aarch64-linux-gnu/pkgconfig"
143
- SASL2_DIR : " /usr/lib/aarch64-linux-gnu"
144
- OPENSSL_DIR : " /usr/lib/aarch64-linux-gnu"
145
- OPENSSL_ROOT_DIR : " /usr/lib/aarch64-linux-gnu"
146
- OPENSSL_STATIC : " 1"
147
- SASL2_STATIC : " 0"
148
- # Add the fix as a pre-run script right before cargo build runs
149
- # This is a workaround since actions-rs/cargo doesn't support pre-commands
119
+ key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{
120
+ hashFiles('**/Cargo.lock') }}
121
+ - name : Find and fix librdkafka CMakeLists.txt
122
+ if : runner.os == 'Linux' || runner.os == 'macOS'
150
123
run : |
151
124
cargo fetch
152
-
153
125
# Find the rdkafka-sys package directory
154
126
RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
155
127
echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
156
-
157
128
# Find the librdkafka CMakeLists.txt file
158
129
CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
159
-
160
130
if [ -f "$CMAKE_FILE" ]; then
161
131
echo "Found CMakeLists.txt at: $CMAKE_FILE"
162
-
163
132
# Make a backup of the original file
164
133
cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
165
-
166
- # Replace the minimum required version - with OS-specific syntax
167
- if [ "${{ runner.os }}" == "macOS" ]; then
168
- sed -i '' 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
169
- else
170
- sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
171
- fi
172
-
134
+ # Replace the minimum required version
135
+ sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
173
136
echo "Modified CMakeLists.txt - before and after comparison:"
174
137
diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
175
138
else
176
139
echo "Could not find librdkafka CMakeLists.txt file!"
177
140
exit 1
178
141
fi
179
-
180
- # Now run the actual build
181
- cargo build --target ${{ matrix.target }} --features kafka --release
142
+ - name : Build with Kafka
143
+ uses : actions-rs/cargo@v1
144
+ with :
145
+ use-cross : ${{ runner.os == 'Linux' }}
146
+ command : build
147
+ args : --target ${{ matrix.target }} --features kafka --release
148
+ env :
149
+ LIBRDKAFKA_SSL_VENDORED : 1
150
+ PKG_CONFIG_ALLOW_CROSS : " 1"
151
+ PKG_CONFIG_PATH : /usr/lib/aarch64-linux-gnu/pkgconfig
152
+ SASL2_DIR : /usr/lib/aarch64-linux-gnu
153
+ OPENSSL_DIR : /usr/lib/aarch64-linux-gnu
154
+ OPENSSL_ROOT_DIR : /usr/lib/aarch64-linux-gnu
155
+ OPENSSL_STATIC : " 1"
156
+ SASL2_STATIC : " 0"
0 commit comments