| # 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. | |
| # # CI runners | |
| # | |
| # Some actions use Runs-On to run on ASF infrastructure: | |
| # https://datafusion.apache.org/contributor-guide/#ci-runners | |
| # | |
| # Small, short jobs run on `ubuntu-slim`, which starts quickly even when the | |
| # shared `ubuntu-latest` pool is backed up. A job belongs there if it stays | |
| # well within one vCPU, 5 GB of memory, and 15 minutes, and needs no Docker. | |
| # Slim has no Rust toolchain; slim jobs that run Cargo set up Rust with | |
| # `.github/actions/setup-rustup`. | |
| # | |
| # # `cargo xtask` | |
| # | |
| # Individual CI commands are implemented with `cargo xtask` to make them easier | |
| # to reproduce locally. | |
| # | |
| # See `xtask/README.md` for details about DataFusion's `xtask` tooling. | |
| # | |
| # It is being rolled out incrementally across all workflows. | |
| # Track progress at https://github.com/apache/datafusion/issues/24487. | |
| # | |
| # # Pushes to `main` | |
| # | |
| # Commits reach upstream `main` through the merge queue, which runs this | |
| # workflow at the same SHA. A push to upstream `main` therefore runs only the | |
| # jobs that save caches, publish coverage, or run the non-required FFI check. | |
| # The other jobs carry an `if:` that skips them for that event alone. PRs, the | |
| # merge queue, `workflow_dispatch`, and every other branch run all jobs. A | |
| # direct push that bypasses the queue is not re-checked; dispatch the workflow | |
| # on `main` for a full run. `ci/scripts/check_rust_workflow_skips.py` keeps | |
| # the skipped set explicit. | |
| # | |
| # # Pull requests from forks | |
| # | |
| # A PR from a fork runs this workflow on the fork, on the contributor's own | |
| # runners, and `fork_ci_status.yml` mirrors that run as the `Rust (fork)` check | |
| # on the PR. Upstream runs `check-fmt`, `check-workflow-tool-installs`, and | |
| # `examples-check-datafusion-crates` for such a PR; the other jobs carry an | |
| # `if:` that skips them. The merge queue runs every job on the merged result, | |
| # so it stays the gate. PRs from branches in this repository, and fork PRs to | |
| # release branches, which have no merge queue, run every job here, as before. | |
| # | |
| name: Rust | |
| concurrency: | |
| # Fork pushes cancel superseded runs on the same branch. Upstream main and | |
| # merge queue runs keep separate groups for each SHA. | |
| group: ${{ github.repository }}-${{ github.head_ref || (github.repository == 'apache/datafusion' && github.sha || github.ref) }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'gh-readonly-queue/**' | |
| - 'dependabot/**' | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/pull_request_template.md" | |
| pull_request: | |
| # manual trigger | |
| # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
| workflow_dispatch: | |
| merge_group: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Check crate compiles and base cargo check passes | |
| linux-build-lib: | |
| name: linux build test | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=8,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| shared-key: "amd-ci-check" # Keep cargo check artifacts separate from test builds. | |
| save-if: ${{ github.ref_name == 'main' }} | |
| - name: Prepare cargo build | |
| # `--locked` asserts that Cargo.lock is up to date with the manifest. | |
| run: cargo xtask ci step check workspace | |
| - name: Archive Cargo check artifacts | |
| id: archive-check | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') }} | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/cargo-check" | |
| # Preserve source timestamps so Cargo can reuse workspace crates. | |
| git ls-files -z | tar --null -T - -cf "$RUNNER_TEMP/cargo-check/check-workspace.tar" target | |
| # -C incremental=false creates per-crate caches named "false". | |
| tar --anchored --no-wildcards-match-slash \ | |
| --exclude='registry/src/*/*/false' \ | |
| -cf "$RUNNER_TEMP/cargo-check/check-registry.tar" -C "$CARGO_HOME" registry | |
| - name: Upload Cargo check artifacts | |
| if: ${{ steps.archive-check.outcome == 'success' && !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') }} | |
| continue-on-error: true | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: cargo-check | |
| path: ${{ runner.temp }}/cargo-check/ | |
| compression-level: 1 | |
| retention-days: 1 | |
| if-no-files-found: error | |
| overwrite: true | |
| # Check datafusion-common features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-datafusion-common-features: | |
| name: cargo check datafusion-common features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: false # The workspace and functions checks save this cache on main. | |
| shared-key: "amd-ci-check" | |
| - name: Check datafusion-common (default features) | |
| run: cargo xtask ci step check datafusion-common default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion-common (no-default-features) | |
| run: cargo xtask ci step check datafusion-common no-default | |
| # Note: don't check other feature flags as datafusion-common is not typically used standalone | |
| # Check datafusion-substrait features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-datafusion-substrait-features: | |
| name: cargo check datafusion-substrait features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Download Cargo check artifacts | |
| id: download-check | |
| continue-on-error: true | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: cargo-check | |
| path: ${{ runner.temp }}/cargo-check | |
| - name: Restore Cargo check artifacts | |
| if: steps.download-check.outcome == 'success' | |
| run: | | |
| tar -xf "$RUNNER_TEMP/cargo-check/check-workspace.tar" | |
| tar -xf "$RUNNER_TEMP/cargo-check/check-registry.tar" -C "$CARGO_HOME" | |
| - name: Check datafusion-substrait (default features) | |
| run: cargo xtask ci step check datafusion-substrait default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion-substrait (no-default-features) | |
| run: cargo xtask ci step check datafusion-substrait no-default | |
| - name: Check datafusion-substrait (physical) | |
| run: cargo xtask ci step check datafusion-substrait physical | |
| - name: Install cmake | |
| run: | | |
| # note the builder setup runs apt-get update / installs protobuf compiler | |
| apt-get install -y cmake | |
| - name: Check datafusion-substrait (protoc) | |
| run: cargo xtask ci step check datafusion-substrait protoc | |
| # Check datafusion-proto features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-datafusion-proto-features: | |
| name: cargo check datafusion-proto features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: false # The workspace and functions checks save this cache on main. | |
| shared-key: "amd-ci-check" | |
| - name: Check datafusion-proto (default features) | |
| run: cargo xtask ci step check datafusion-proto default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion-proto (no-default-features) | |
| run: cargo xtask ci step check datafusion-proto no-default | |
| - name: Check datafusion-proto (json) | |
| run: cargo xtask ci step check datafusion-proto json | |
| - name: Check datafusion-proto (parquet) | |
| run: cargo xtask ci step check datafusion-proto parquet | |
| - name: Check datafusion-proto (avro) | |
| run: cargo xtask ci step check datafusion-proto avro | |
| # Check datafusion-ffi features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-datafusion-ffi-features: | |
| name: cargo check datafusion-ffi features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: false # The workspace and functions checks save this cache on main. | |
| shared-key: "amd-ci-check" | |
| - name: Check datafusion-ffi (no-default-features) | |
| run: cargo xtask ci step check datafusion-ffi no-default | |
| # Check datafusion crate features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-cargo-check-datafusion: | |
| name: cargo check datafusion features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Download Cargo check artifacts | |
| id: download-check | |
| continue-on-error: true | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: cargo-check | |
| path: ${{ runner.temp }}/cargo-check | |
| - name: Restore Cargo check artifacts | |
| if: steps.download-check.outcome == 'success' | |
| run: | | |
| tar -xf "$RUNNER_TEMP/cargo-check/check-workspace.tar" | |
| tar -xf "$RUNNER_TEMP/cargo-check/check-registry.tar" -C "$CARGO_HOME" | |
| - name: Check datafusion (default features) | |
| run: cargo xtask ci step check datafusion default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion (no-default-features) | |
| run: cargo xtask ci step check datafusion no-default | |
| - name: Check datafusion (nested_expressions) | |
| run: cargo xtask ci step check datafusion nested_expressions | |
| - name: Check datafusion (array_expressions) | |
| run: cargo xtask ci step check datafusion array_expressions | |
| - name: Check datafusion (avro) | |
| run: cargo xtask ci step check datafusion avro | |
| - name: Check datafusion (backtrace) | |
| run: cargo xtask ci step check datafusion backtrace | |
| - name: Check datafusion (compression) | |
| run: cargo xtask ci step check datafusion compression | |
| - name: Check datafusion (crypto_expressions) | |
| run: cargo xtask ci step check datafusion crypto_expressions | |
| - name: Check datafusion (datetime_expressions) | |
| run: cargo xtask ci step check datafusion datetime_expressions | |
| - name: Check datafusion (encoding_expressions) | |
| run: cargo xtask ci step check datafusion encoding_expressions | |
| - name: Check datafusion (force_hash_collisions) | |
| run: cargo xtask ci step check datafusion force_hash_collisions | |
| - name: Check datafusion (math_expressions) | |
| run: cargo xtask ci step check datafusion math_expressions | |
| - name: Check datafusion (parquet) | |
| run: cargo xtask ci step check datafusion parquet | |
| - name: Check datafusion (regex_expressions) | |
| run: cargo xtask ci step check datafusion regex_expressions | |
| - name: Check datafusion (recursive_protection) | |
| run: cargo xtask ci step check datafusion recursive_protection | |
| - name: Check datafusion (serde) | |
| run: cargo xtask ci step check datafusion serde | |
| - name: Check datafusion (sql) | |
| run: cargo xtask ci step check datafusion sql | |
| - name: Check datafusion (string_expressions) | |
| run: cargo xtask ci step check datafusion string_expressions | |
| - name: Check datafusion (unicode_expressions) | |
| run: cargo xtask ci step check datafusion unicode_expressions | |
| - name: Check parquet encryption (parquet_encryption) | |
| run: cargo xtask ci step check datafusion parquet_encryption | |
| # Check datafusion-functions crate features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| linux-cargo-check-datafusion-functions: | |
| name: cargo check datafusion-functions features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| # Warm GitHub's cache when linux-build-lib saves to Runs-On. | |
| save-if: ${{ github.ref_name == 'main' }} | |
| shared-key: "amd-ci-check" | |
| - name: Check datafusion-functions (default features) | |
| run: cargo xtask ci step check datafusion-functions default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion-functions (no-default-features) | |
| run: cargo xtask ci step check datafusion-functions no-default | |
| - name: Check datafusion-functions (crypto_expressions) | |
| run: cargo xtask ci step check datafusion-functions crypto_expressions | |
| - name: Check datafusion-functions (datetime_expressions) | |
| run: cargo xtask ci step check datafusion-functions datetime_expressions | |
| - name: Check datafusion-functions (encoding_expressions) | |
| run: cargo xtask ci step check datafusion-functions encoding_expressions | |
| - name: Check datafusion-functions (math_expressions) | |
| run: cargo xtask ci step check datafusion-functions math_expressions | |
| - name: Check datafusion-functions (regex_expressions) | |
| run: cargo xtask ci step check datafusion-functions regex_expressions | |
| - name: Check datafusion-functions (string_expressions) | |
| run: cargo xtask ci step check datafusion-functions string_expressions | |
| - name: Check datafusion-functions (unicode_expressions) | |
| run: cargo xtask ci step check datafusion-functions unicode_expressions | |
| # Check datafusion-spark crate features | |
| # | |
| # Ensure via `cargo check` that the crate can be built with a | |
| # subset of the features packages enabled. | |
| # See https://github.com/apache/datafusion/issues/24474 | |
| linux-cargo-check-datafusion-spark: | |
| name: cargo check datafusion-spark features | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: false # The workspace and functions checks save this cache on main. | |
| shared-key: "amd-ci-check" | |
| - name: Check datafusion-spark (default features) | |
| run: cargo xtask ci step check datafusion-spark default | |
| # | |
| # Note: Only check libraries (not --all-targets) to cover end user APIs | |
| # | |
| - name: Check datafusion-spark (no-default-features) | |
| run: cargo xtask ci step check datafusion-spark no-default | |
| - name: Check datafusion-spark (core) | |
| run: cargo xtask ci step check datafusion-spark core | |
| # Library and integration tests | |
| linux-test: | |
| name: cargo test (amd64) | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| volumes: | |
| - /usr/local:/host/usr/local | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Install llvm-tools-preview | |
| run: rustup component add llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: ${{ github.ref_name == 'main' }} | |
| shared-key: "amd-ci" | |
| - name: Run tests (excluding doctests and datafusion-cli) | |
| env: | |
| RUST_BACKTRACE: 1 | |
| run: cargo xtask ci step test workspace | |
| - parallel: | |
| - name: Verify Working Directory Clean | |
| run: git diff --exit-code | |
| # Check no temporary directories created during test. | |
| # `false/` folder is excuded for rust cache. | |
| - name: Verify Working Directory Clean (No Untracked Files) | |
| run: | | |
| STATUS="$(git status --porcelain | sed -e '/^?? false\/$/d' -e '/^?? false$/d')" | |
| if [ -n "$STATUS" ]; then | |
| echo "$STATUS" | |
| exit 1 | |
| fi | |
| - name: Upload coverage to codecov.io | |
| uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 | |
| with: | |
| files: target/codecov.json | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # datafusion-cli tests | |
| linux-test-datafusion-cli: | |
| name: cargo test datafusion-cli (amd64) | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| run: rustup toolchain install stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: false # set in linux-test | |
| shared-key: "amd-ci" | |
| # The storage integration tests start RustFS containers. Pulling the image | |
| # once up front keeps the pull off the critical path of the tests, which | |
| # would otherwise pull it several times concurrently and occasionally fail | |
| # with transient Docker transport errors. The tests retry the pull | |
| # themselves, so a failure here is only a warning. | |
| # | |
| # RUSTFS_IMAGE must match RUSTFS_IMAGE_NAME and RUSTFS_IMAGE_TAG in | |
| # `datafusion-cli/tests/cli_integration.rs`. The | |
| # `rustfs_image_matches_ci_prepull` test fails if they differ. | |
| - name: Pre-pull RustFS image | |
| env: | |
| RUSTFS_IMAGE: docker.io/rustfs/rustfs:1.0.0 | |
| run: | | |
| ci/scripts/retry timeout 120 docker pull "$RUSTFS_IMAGE" \ | |
| || echo "::warning::Could not pre-pull $RUSTFS_IMAGE, the tests will pull it themselves" | |
| - name: Run tests (excluding doctests) | |
| env: | |
| RUST_BACKTRACE: 1 | |
| AWS_ENDPOINT: http://127.0.0.1:9000 | |
| AWS_ACCESS_KEY_ID: TEST-DataFusionLogin | |
| AWS_SECRET_ACCESS_KEY: TEST-DataFusionPassword | |
| TEST_STORAGE_INTEGRATION: 1 | |
| AWS_ALLOW_HTTP: true | |
| run: cargo xtask ci step test cli | |
| - name: Verify Working Directory Clean | |
| run: git diff --exit-code | |
| linux-test-example: | |
| name: cargo examples (amd64) | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: ${{ github.ref_name == 'main' }} | |
| shared-key: "amd-ci-linux-test-example" | |
| - name: Run examples | |
| run: | | |
| # test datafusion-sql examples | |
| cargo run --profile ci --example sql | |
| # test datafusion-examples | |
| ci/scripts/rust_example.sh | |
| - name: Verify Working Directory Clean | |
| run: git diff --exit-code | |
| # Run `cargo test doc` (test documentation examples) | |
| linux-test-doc: | |
| name: cargo test doc (amd64) | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Run doctests | |
| run: cargo xtask ci step test doctest | |
| - name: Verify Working Directory Clean | |
| run: git diff --exit-code | |
| # Run `cargo doc` to ensure the rustdoc is clean | |
| linux-rustdoc: | |
| name: cargo doc | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Run cargo doc | |
| run: ci/scripts/rust_docs.sh | |
| linux-wasm-pack: | |
| name: build and run with wasm-pack | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| # Use the preinstalled Clang 18 even if the runner's default Clang changes. | |
| CC_wasm32_unknown_unknown: clang-18 | |
| CXX_wasm32_unknown_unknown: clang++-18 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - parallel: | |
| - name: Setup for wasm32 | |
| run: | | |
| rustup target add wasm32-unknown-unknown | |
| - name: Check preinstalled Clang | |
| run: | | |
| clang-18 --version | |
| clang++-18 --version | |
| - name: Setup wasm-pack | |
| uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29 | |
| with: | |
| tool: wasm-pack | |
| - name: Run tests with headless mode | |
| working-directory: ./datafusion/wasmtest | |
| run: | | |
| # debuginfo=none because CI tests weren't completing successfully after this upstream PR: | |
| # https://github.com/wasm-bindgen/wasm-bindgen/pull/4635 | |
| RUSTFLAGS='--cfg getrandom_backend="wasm_js" -C debuginfo=none' wasm-pack test --headless --firefox | |
| RUSTFLAGS='--cfg getrandom_backend="wasm_js" -C debuginfo=none' wasm-pack test --headless --chrome --chromedriver $CHROMEWEBDRIVER/chromedriver | |
| # verify that the benchmark queries return the correct results | |
| verify-benchmark-results: | |
| name: verify benchmark results (amd64) | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - parallel: | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Generate benchmark data and expected query results | |
| run: | | |
| mkdir -p datafusion/sqllogictest/test_files/tpch/data | |
| git clone https://github.com/databricks/tpch-dbgen.git | |
| cd tpch-dbgen | |
| make | |
| ./dbgen -f -s 0.1 | |
| mv *.tbl ../datafusion/sqllogictest/test_files/tpch/data | |
| - name: Verify that benchmark queries return expected results | |
| run: | | |
| cargo xtask ci step test benchmark-plan | |
| cargo xtask ci step test benchmark-sqllogic | |
| - name: Verify Working Directory Clean | |
| run: git diff --exit-code | |
| sqllogictest-postgres: | |
| name: "Run sqllogictest with Postgres runner" | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: db_test | |
| POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=C --lc-ctype=C | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Run sqllogictest | |
| run: cargo xtask ci step test postgres | |
| env: | |
| # use postgres for the host here because we have specified a container for the job | |
| POSTGRES_HOST: postgres | |
| POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} | |
| sqllogictest-substrait: | |
| name: "Run sqllogictest in Substrait round-trip mode" | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - name: Run sqllogictest | |
| # TODO: Right now several tests are failing in Substrait round-trip mode, so this | |
| # command cannot be run for all the .slt files. Run a supported subset | |
| # until most of the tickets in https://github.com/apache/datafusion/issues/16248 are addressed | |
| # and this command can be run without filters. | |
| run: | | |
| cargo xtask ci step test substrait | |
| cargo xtask ci step test substrait-optimized | |
| # Temporarily commenting out the Windows flow, the reason is enormously slow running build | |
| # Waiting for new Windows 2025 github runner | |
| # Details: https://github.com/apache/datafusion/issues/13726 | |
| # | |
| # windows: | |
| # name: cargo test (win64) | |
| # runs-on: windows-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # submodules: true | |
| # - name: Setup Rust toolchain | |
| # uses: ./.github/actions/setup-windows-builder | |
| # - name: Run tests (excluding doctests) | |
| # shell: bash | |
| # run: | | |
| # export PATH=$PATH:$HOME/d/protoc/bin | |
| # cargo test --lib --tests --bins --features avro,json,backtrace | |
| # macOS scope is narrowed to `datafusion-ffi`: the only bug class amd64 | |
| # cannot reproduce is FFI cdylib loading (`.dylib` vs `.so` resolution in | |
| # datafusion/ffi/src/tests/utils.rs). All other macos-only failures | |
| # historically came from datafusion-benchmarks (now covered on amd64) or | |
| # flaky sqllogictest metrics. | |
| macos-aarch64: | |
| name: cargo test (macos-aarch64) | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-macos-aarch64-builder | |
| - name: Run datafusion-ffi tests | |
| shell: bash | |
| run: cargo xtask ci step test ffi | |
| vendor: | |
| name: Verify Vendored Code | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-rustup | |
| - name: Install protoc | |
| uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29 | |
| with: | |
| tool: protoc@3.21.12 | |
| - name: Run gen | |
| run: ./regen.sh | |
| working-directory: ./datafusion/proto | |
| - name: Verify workspace clean (if this fails, run ./datafusion/proto/regen.sh and check in results) | |
| run: git diff --exit-code | |
| check-fmt: | |
| name: Check cargo fmt | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-rustup | |
| - name: Run | |
| run: | | |
| ci/scripts/rust_fmt.sh | |
| check-workflow-tool-installs: | |
| name: Check GitHub Actions install tooling | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Check workflow tool installs | |
| run: ci/scripts/check_no_cargo_install_in_workflows.sh | |
| clippy: | |
| name: clippy | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - parallel: | |
| - name: Install Clippy | |
| run: rustup component add clippy | |
| - name: Rust Dependency Cache | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| save-if: ${{ github.ref_name == 'main' }} | |
| shared-key: "amd-ci-clippy" | |
| - name: Install CMake | |
| # The all-features check builds snmalloc-sys, which requires CMake. | |
| run: apt-get install -y --no-install-recommends cmake | |
| - name: Run clippy | |
| run: ci/scripts/rust_clippy.sh | |
| cargo-toml-formatting-checks: | |
| name: check Cargo.toml formatting | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Install taplo | |
| uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29 | |
| with: | |
| tool: taplo-cli@0.9 | |
| # if you encounter an error, try running 'taplo format' to fix the formatting automatically. | |
| - name: Check Cargo.toml formatting | |
| run: taplo format --check | |
| config-docs-check: | |
| name: check configs.md and ***_functions.md is up-to-date | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| with: | |
| rust-version: stable | |
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: "20" | |
| - name: Check generated config and function docs | |
| run: | | |
| ./ci/scripts/check_generated_docs.sh | |
| git diff --exit-code | |
| # This job ensures `datafusion-examples/README.md` stays in sync with the source code: | |
| # 1. Generates README automatically using the Rust examples docs generator | |
| # (parsing documentation from `examples/<group>/main.rs`) | |
| # 2. Formats the generated Markdown using DataFusion's standard Prettier setup | |
| # 3. Compares the result against the committed README.md and fails if out-of-date | |
| examples-docs-check: | |
| name: check example README is up-to-date | |
| needs: linux-build-lib | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - parallel: | |
| - name: Mark repository as safe for git | |
| # Required for git commands inside container (avoids "dubious ownership" error) | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Set up Node.js (required for prettier) | |
| # doc_prettier_check.sh uses npx to run prettier for Markdown formatting | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: '18' | |
| - name: Run examples docs check script | |
| run: | | |
| bash ci/scripts/check_examples_docs.sh | |
| # Ensures that the examples only use the main `datafusion` crate and not its subcrates, which are | |
| # already exported by `datafusion` (there are a few exceptions, like `datafusion-proto`). | |
| # See: https://github.com/apache/datafusion/pull/14305 | |
| examples-check-datafusion-crates: | |
| name: Check datafusion crates used in datafusion-examples | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - run: python3 ci/scripts/check_examples_datafusion_crates.py | |
| # Verify MSRV for the crates which are directly used by other projects: | |
| # - datafusion | |
| # - datafusion-substrait | |
| # - datafusion-proto | |
| # - datafusion-cli | |
| msrv: | |
| name: Verify MSRV (Min Supported Rust Version) | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: amd64/rust | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-builder | |
| - name: Install cargo-msrv | |
| uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2.87.29 | |
| with: | |
| tool: cargo-msrv | |
| - name: Check datafusion | |
| working-directory: datafusion/core | |
| run: | | |
| # If you encounter an error with any of the commands below it means | |
| # your code or some crate in the dependency tree has a higher MSRV | |
| # (Min Supported Rust Version) than the one specified in the | |
| # `rust-version` key of `Cargo.toml`. | |
| # | |
| # To reproduce: | |
| # 1. Install the version of Rust that is failing. | |
| # 2. Run the command that failed with that version. | |
| # | |
| # Example: | |
| # # MSRV looks like "1.80.0" and is specified in Cargo.toml. We can read the value with the following command: | |
| # msrv="$(cargo metadata --format-version=1 | jq '.packages[] | select( .name == "datafusion" ) | .rust_version' -r)" | |
| # echo "MSRV: ${msrv}" | |
| # rustup install "${msrv}" | |
| # cargo "+${msrv}" check | |
| # | |
| # To resolve, either: | |
| # 1. Change your code to use older Rust features, | |
| # 2. Revert dependency update | |
| # 3. Update the MSRV version in `Cargo.toml` | |
| # | |
| # Please see the DataFusion Rust Version Compatibility Policy before | |
| # updating Cargo.toml. You may have to update the code instead. | |
| # https://github.com/apache/datafusion/blob/main/README.md#rust-version-compatibility-policy | |
| cargo msrv --output-format json --log-target stdout verify | |
| - name: Check datafusion-substrait | |
| working-directory: datafusion/substrait | |
| run: cargo msrv --output-format json --log-target stdout verify | |
| - name: Check datafusion-proto | |
| working-directory: datafusion/proto | |
| run: cargo msrv --output-format json --log-target stdout verify | |
| # Check for dependency cycles between DataFusion crates, which would block | |
| # publishing them to crates.io, with a publishing dry run. | |
| depcheck: | |
| name: Circular Dependency Check | |
| if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: ./.github/actions/setup-rustup | |
| - name: Check dependencies | |
| run: bash ci/scripts/check_circular_dependencies.sh |