4646 RUST_VERSION : stable
4747
4848jobs :
49-
50- # Run Rust tests once per JDK version
49+
50+ # Build native library once and share with all test jobs
51+ build-native :
52+ name : Build Native Library
53+ runs-on : ubuntu-latest
54+ container :
55+ image : amd64/rust
56+ steps :
57+ - uses : actions/checkout@v6
58+
59+ - name : Setup Rust toolchain
60+ uses : ./.github/actions/setup-builder
61+ with :
62+ rust-version : ${{ env.RUST_VERSION }}
63+ jdk-version : 17 # JDK only needed for common module proto generation
64+
65+ - name : Cache Cargo
66+ uses : actions/cache@v4
67+ with :
68+ path : |
69+ ~/.cargo/registry
70+ ~/.cargo/git
71+ native/target
72+ key : ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
73+ restore-keys : |
74+ ${{ runner.os }}-cargo-ci-
75+
76+ - name : Build native library (CI profile)
77+ run : |
78+ cd native
79+ # CI profile: same overflow behavior as release, but faster compilation
80+ # (no LTO, parallel codegen)
81+ cargo build --profile ci
82+
83+ - name : Upload native library
84+ uses : actions/upload-artifact@v4
85+ with :
86+ name : native-lib-linux
87+ path : native/target/ci/libcomet.so
88+ retention-days : 1
89+
90+ # Run Rust tests (runs in parallel with build-native, uses debug builds)
5191 linux-test-rust :
5292 strategy :
5393 matrix :
@@ -60,15 +100,29 @@ jobs:
60100 image : amd64/rust
61101 steps :
62102 - uses : actions/checkout@v6
103+
63104 - name : Setup Rust & Java toolchain
64105 uses : ./.github/actions/setup-builder
65106 with :
66- rust-version : ${{env.RUST_VERSION}}
107+ rust-version : ${{ env.RUST_VERSION }}
67108 jdk-version : ${{ matrix.java_version }}
109+
110+ - name : Cache Cargo
111+ uses : actions/cache@v4
112+ with :
113+ path : |
114+ ~/.cargo/registry
115+ ~/.cargo/git
116+ native/target
117+ key : ${{ runner.os }}-cargo-debug-java${{ matrix.java_version }}-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
118+ restore-keys : |
119+ ${{ runner.os }}-cargo-debug-java${{ matrix.java_version }}-
120+
68121 - name : Rust test steps
69122 uses : ./.github/actions/rust-test
70-
123+
71124 linux-test :
125+ needs : build-native
72126 strategy :
73127 matrix :
74128 os : [ubuntu-latest]
@@ -134,6 +188,9 @@ jobs:
134188 org.apache.spark.sql.comet.ParquetEncryptionITCase
135189 org.apache.comet.exec.CometNativeReaderSuite
136190 org.apache.comet.CometIcebergNativeSuite
191+ - name : " csv"
192+ value : |
193+ org.apache.comet.csv.CometCsvNativeReadSuite
137194 - name : " exec"
138195 value : |
139196 org.apache.comet.exec.CometAggregateSuite
@@ -187,11 +244,31 @@ jobs:
187244
188245 steps :
189246 - uses : actions/checkout@v6
247+
190248 - name : Setup Rust & Java toolchain
191249 uses : ./.github/actions/setup-builder
192250 with :
193- rust-version : ${{env.RUST_VERSION}}
251+ rust-version : ${{ env.RUST_VERSION }}
194252 jdk-version : ${{ matrix.profile.java_version }}
253+
254+ - name : Download native library
255+ uses : actions/download-artifact@v4
256+ with :
257+ name : native-lib-linux
258+ # Download to release/ since Maven's -Prelease expects libcomet.so there
259+ path : native/target/release/
260+
261+ # Restore cargo registry cache (for any cargo commands that might run)
262+ - name : Cache Cargo registry
263+ uses : actions/cache@v4
264+ with :
265+ path : |
266+ ~/.cargo/registry
267+ ~/.cargo/git
268+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('native/**/Cargo.lock') }}
269+ restore-keys : |
270+ ${{ runner.os }}-cargo-registry-
271+
195272 - name : Java test steps
196273 uses : ./.github/actions/java-test
197274 with :
@@ -200,3 +277,4 @@ jobs:
200277 maven_opts : ${{ matrix.profile.maven_opts }}
201278 scan_impl : ${{ matrix.profile.scan_impl }}
202279 upload-test-reports : true
280+ skip-native-build : true
0 commit comments