Skip to content

Commit

Permalink
build: try clean
Browse files Browse the repository at this point in the history
  • Loading branch information
tshauck committed Jun 30, 2024
1 parent 01147d2 commit c1af955
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 51 deletions.
69 changes: 32 additions & 37 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ concurrency:
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- "docs/**"
- "**.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- "docs/**"
- "**.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
# manual trigger
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
# Run tests
linux-test:
name: cargo test (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -145,15 +145,15 @@ jobs:
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
rust-version: stable
- name: Run tests (excluding doctests)
run: cargo test --lib --tests --bins --features avro,json,backtrace
- name: Verify Working Directory Clean
run: git diff --exit-code

linux-test-datafusion-cli:
name: cargo test datafusion-cli (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -174,18 +174,11 @@ jobs:

linux-test-example:
name: cargo examples (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- run: |
# clear space for the examples
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "$AGENT_TOOLSDIRECTORY"
rm -rf "/usr/local/share/boost"
- uses: actions/checkout@v4
with:
submodules: true
Expand All @@ -202,10 +195,12 @@ jobs:
- 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]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -228,7 +223,7 @@ jobs:
# Run `cargo doc` to ensure the rustdoc is clean
linux-rustdoc:
name: cargo doc
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand Down Expand Up @@ -265,7 +260,7 @@ jobs:
# verify that the benchmark queries return the correct results
verify-benchmark-results:
name: verify benchmark results (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand Down Expand Up @@ -295,8 +290,8 @@ jobs:
run: git diff --exit-code

sqllogictest-postgres:
name: 'Run sqllogictest with Postgres runner'
needs: [linux-build-lib]
name: "Run sqllogictest with Postgres runner"
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -348,15 +343,15 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/setup-macos-builder
uses: ./.github/actions/setup-macos-builder
- name: Run tests (excluding doctests)
shell: bash
run: |
cargo test --lib --tests --bins --features avro,json,backtrace
cd datafusion-cli
cargo test --lib --tests --bins --all-features
cargo test --lib --tests --bins --all-features
macos-aarch64:
name: cargo test (macos-aarch64)
Expand All @@ -376,7 +371,7 @@ jobs:
test-datafusion-pyarrow:
name: cargo test pyarrow (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-20.04
container:
image: amd64/rust:bullseye # Workaround https://github.com/actions/setup-python/issues/721
Expand All @@ -386,7 +381,7 @@ jobs:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: "3.8"
- name: Install PyArrow
run: |
echo "LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
Expand Down Expand Up @@ -473,7 +468,7 @@ jobs:

clippy:
name: clippy
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -493,7 +488,7 @@ jobs:
# Check answers are correct when hash values collide
hash-collisions:
name: cargo test hash collisions (amd64)
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -512,7 +507,7 @@ jobs:
cargo-toml-formatting-checks:
name: check Cargo.toml formatting
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -532,7 +527,7 @@ jobs:

config-docs-check:
name: check configs.md is up-to-date
needs: [linux-build-lib]
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
Expand All @@ -546,7 +541,7 @@ jobs:
rust-version: stable
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"
- name: Check if configs.md has been modified
run: |
# If you encounter an error, run './dev/update_config_docs.sh' and commit
Expand All @@ -573,9 +568,9 @@ jobs:
working-directory: datafusion/core
run: |
# If you encounter an error with any of the commands below
# it means some crate in your dependency tree has a higher
# MSRV (Min Supported Rust Version) than the one specified
# in the `rust-version` key of `Cargo.toml`. Check your
# it means some crate in your dependency tree has a higher
# MSRV (Min Supported Rust Version) than the one specified
# in the `rust-version` key of `Cargo.toml`. Check your
# dependencies or update the version in `Cargo.toml`
cargo msrv verify
- name: Check datafusion-substrait
Expand Down
14 changes: 0 additions & 14 deletions ci/scripts/rust_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,16 @@
# under the License.

set -ex

repo_dir=$PWD

cd datafusion-examples/examples/
cargo fmt --all -- --check
cargo check --examples

size_threshold=$((1 * 1024 * 1024 * 1024)) # 1GB

files=$(ls .)
for filename in $files
do
example_name=`basename $filename ".rs"`
# Skip tests that rely on external storage and flight
if [ ! -d $filename ]; then
cargo run --example $example_name

# If the examples are getting too big, run cargo clean
current_size=$(du -s $repo_dir/target/debug | awk '{print $1}')

if [ $current_size -gt $size_threshold ]; then
echo "Cleaning cargo due to directory size exceeding 10 GB..."
cargo clean
fi

fi
done

0 comments on commit c1af955

Please sign in to comment.