Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 120 additions & 90 deletions .github/workflows/README.md

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions .github/workflows/build_linux_native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Single producer for the default Linux CI native library. The umbrella runs
# this whenever any Linux, Spark SQL, or Iceberg test consumer is selected.
name: Build Linux Native Library

on:
workflow_call:

permissions:
contents: read

env:
RUST_VERSION: stable
RUST_BACKTRACE: 1

jobs:
# Build native library once and share with all test jobs
build-native:
name: Build Native Library
runs-on: ubuntu-24.04
container:
image: amd64/rust
steps:
- uses: actions/checkout@v7
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.RUST_VERSION }}
jdk-version: 17 # Matches the existing Linux producer, including libjvm linkage.

- name: Check Rust formatting
run: cd native && cargo fmt --all -- --check

- name: Restore Cargo cache
uses: actions/cache/restore@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
native/target
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
restore-keys: |
${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-

- name: Build native library (CI profile)
run: |
cd native
# CI profile: same overflow behavior as release, but faster compilation
# (no LTO, parallel codegen)
cargo build --profile ci
env:
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd"

- name: Upload native library
uses: ./.github/actions/upload-artifact-retry
with:
name: native-lib-linux
path: native/target/ci/libcomet.so
retention-days: 1

- name: Save Cargo cache
uses: actions/cache/save@v6
if: github.ref == 'refs/heads/main'
with:
path: |
~/.cargo/registry
~/.cargo/git
native/target
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
54 changes: 44 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ jobs:
run: python3 dev/ci/test-iceberg-shards.py

- name: Check CI config invariants
run: python3 dev/ci/check-ci-config.py
run: |
python3 dev/ci/check-ci-config.py
python3 dev/ci/test-ci-config.py
python3 dev/ci/test-native-build-selection.py

- name: Install actionlint
# Pure network, and preflight gates every other job, so a single reset
Expand Down Expand Up @@ -153,6 +156,7 @@ jobs:
needs: preflight
runs-on: ubuntu-slim
outputs:
build_linux_native: ${{ steps.compute.outputs.build_linux_native }}
build_linux: ${{ steps.compute.outputs.build_linux }}
build_macos: ${{ steps.compute.outputs.build_macos }}
benchmark: ${{ steps.compute.outputs.benchmark }}
Expand Down Expand Up @@ -225,11 +229,31 @@ jobs:
# can actually test it.
# ---------------------------------------------------------------------------

# Independent checks start immediately after change selection.
pr_build_linux_checks:
name: PR Checks (Linux)
needs: changes
permissions:
contents: read
if: needs.changes.outputs.build_linux == 'true'
uses: ./.github/workflows/pr_build_linux_checks.yml

# compute-changes.py derives this output from the selected native consumers.
build_linux_native:
name: Shared Linux Native Library
needs: changes
permissions:
contents: read
if: needs.changes.outputs.build_linux_native == 'true'
uses: ./.github/workflows/build_linux_native.yml

pr_build_linux:
name: PR Build (Linux)
needs: changes
needs: [changes, build_linux_native]
if: needs.changes.outputs.build_linux == 'true'
uses: ./.github/workflows/pr_build_linux.yml
with:
native-library-artifact: native-lib-linux

pr_build_macos:
name: PR Build (macOS)
Expand All @@ -254,42 +278,45 @@ jobs:

spark_3_4:
name: Spark SQL Tests (Spark 3.4)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-spark-3.4-tests` label.
if: needs.changes.outputs.spark_3_4 == 'true'
uses: ./.github/workflows/spark_sql_test_reusable.yml
with:
native-library-artifact: native-lib-linux
spark-short: '3.4'
spark-full: '3.4.3'
java: 11

spark_3_5:
name: Spark SQL Tests (Spark 3.5)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-spark-3.5-tests` label.
if: needs.changes.outputs.spark_3_5 == 'true'
uses: ./.github/workflows/spark_sql_test_reusable.yml
with:
native-library-artifact: native-lib-linux
spark-short: '3.5'
spark-full: '3.5.9'
java: 17

spark_4_0:
name: Spark SQL Tests (Spark 4.0)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-spark-4.0-tests` label. Swapped
# with spark_4_1 on the `oom` branch to validate the memory caps against
# Spark 4.1 by default.
if: needs.changes.outputs.spark_4_0 == 'true'
uses: ./.github/workflows/spark_sql_test_reusable.yml
with:
native-library-artifact: native-lib-linux
spark-short: '4.0'
spark-full: '4.0.4'
java: 17

spark_4_1:
name: Spark SQL Tests (Spark 4.1)
needs: changes
needs: [changes, build_linux_native]
# Two POLICY outputs feed one call, so the queue gets every module from a
# single 40-minute build instead of two. `spark_4_1` (PR tier) covers
# catalyst and the sql_core shards; `spark_4_1_hive` (queue-only, or the
Expand All @@ -298,6 +325,7 @@ jobs:
if: needs.changes.outputs.spark_4_1 == 'true' || needs.changes.outputs.spark_4_1_hive == 'true'
uses: ./.github/workflows/spark_sql_test_reusable.yml
with:
native-library-artifact: native-lib-linux
spark-short: '4.1'
spark-full: '4.1.3'
java: 17
Expand All @@ -308,11 +336,12 @@ jobs:

iceberg_1_8:
name: Iceberg Spark SQL Tests (Iceberg 1.8)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-iceberg-tests` label.
if: needs.changes.outputs.iceberg_1_8 == 'true'
uses: ./.github/workflows/iceberg_spark_test_reusable.yml
with:
native-library-artifact: native-lib-linux
iceberg-short: '1.8'
iceberg-full: '1.8.1'
spark-short: '3.4'
Expand All @@ -321,11 +350,12 @@ jobs:

iceberg_1_9:
name: Iceberg Spark SQL Tests (Iceberg 1.9)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-iceberg-tests` label.
if: needs.changes.outputs.iceberg_1_9 == 'true'
uses: ./.github/workflows/iceberg_spark_test_reusable.yml
with:
native-library-artifact: native-lib-linux
iceberg-short: '1.9'
iceberg-full: '1.9.1'
spark-short: '3.5'
Expand All @@ -334,12 +364,13 @@ jobs:

iceberg_1_10:
name: Iceberg Spark SQL Tests (Iceberg 1.10)
needs: changes
needs: [changes, build_linux_native]
# Queue-only by default; PRs need the `run-iceberg-tests` label. Iceberg 1.11
# (Spark 4.1) is the PR-gated Iceberg job; 1.10 covers the Spark 3.5 path.
if: needs.changes.outputs.iceberg_1_10 == 'true'
uses: ./.github/workflows/iceberg_spark_test_reusable.yml
with:
native-library-artifact: native-lib-linux
iceberg-short: '1.10'
iceberg-full: '1.10.0'
spark-short: '3.5'
Expand All @@ -348,11 +379,12 @@ jobs:

iceberg_1_11:
name: Iceberg Spark SQL Tests (Iceberg 1.11)
needs: changes
needs: [changes, build_linux_native]
# Runs on every PR: Iceberg 1.11 is our only Spark 4.1 Iceberg coverage.
if: needs.changes.outputs.iceberg_1_11 == 'true'
uses: ./.github/workflows/iceberg_spark_test_reusable.yml
with:
native-library-artifact: native-lib-linux
iceberg-short: '1.11'
iceberg-full: '1.11.0'
spark-short: '4.1'
Expand Down Expand Up @@ -398,6 +430,8 @@ jobs:
needs:
- preflight
- changes
- pr_build_linux_checks
- build_linux_native
- pr_build_linux
- pr_build_macos
- pr_benchmark_check
Expand Down
Loading
Loading