1717
1818name : Rust
1919
20+ concurrency :
21+ group : ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
22+ cancel-in-progress : true
23+
2024on :
2125 # always trigger on PR
2226 push :
3236 runs-on : ubuntu-latest
3337 container :
3438 image : amd64/rust
35- env :
36- # Disable full debug symbol generation to speed up CI build and keep memory down
37- # "1" means line tables only, which is useful for panic tracebacks.
38- RUSTFLAGS : " -C debuginfo=1"
3939 steps :
4040 - uses : actions/checkout@v3
4141 - name : Cache Cargo
@@ -49,18 +49,17 @@ jobs:
4949 uses : ./.github/actions/setup-builder
5050 with :
5151 rust-version : stable
52- - name : Check workspace in debug mode
53- run : |
54- cargo check
55- - name : Check workspace in release mode
56- run : |
57- cargo check --release
52+
5853 - name : Check workspace without default features
59- run : |
60- cargo check --no-default-features -p datafusion
54+ run : cargo check --no-default-features -p datafusion
55+
56+ - name : Check workspace in debug mode
57+ run : cargo check
58+
59+ # Note: this does not include dictionary_expressions to reduce codegen
6160 - name : Check workspace with all features
62- run : |
63- cargo check --workspace --benches --features avro,jit,scheduler,json
61+ run : cargo check --workspace --benches --features avro,jit,scheduler,json
62+
6463 - name : Check Cargo.lock for datafusion-cli
6564 run : |
6665 # If this test fails, try running `cargo update` in the `datafusion-cli` directory
@@ -70,14 +69,10 @@ jobs:
7069 # test the crate
7170 linux-test :
7271 name : cargo test (amd64)
73- needs : [linux-build-lib]
72+ needs : [ linux-build-lib ]
7473 runs-on : ubuntu-latest
7574 container :
7675 image : amd64/rust
77- env :
78- # Disable full debug symbol generation to speed up CI build and keep memory down
79- # "1" means line tables only, which is useful for panic tracebacks.
80- RUSTFLAGS : " -C debuginfo=1"
8176 steps :
8277 - uses : actions/checkout@v3
8378 with :
@@ -92,17 +87,27 @@ jobs:
9287 uses : ./.github/actions/setup-builder
9388 with :
9489 rust-version : stable
95- - name : Build tests
96- run : |
97- export PATH=$PATH:$HOME/d/protoc/bin
98- cargo test --features avro,jit,scheduler,json,dictionary_expressions --no-run
99- - name : Run tests
100- run : |
101- export PATH=$PATH:$HOME/d/protoc/bin
102- cargo test --features avro,jit,scheduler,json,dictionary_expressions
90+ - name : Run tests (excluding doctests)
91+ run : cargo test --lib --tests --bins --features avro,jit,scheduler,json,dictionary_expressions
92+ - name : Verify Working Directory Clean
93+ run : git diff --exit-code
94+
95+ linux-test-example :
96+ name : cargo examples (amd64)
97+ needs : [ linux-build-lib ]
98+ runs-on : ubuntu-latest
99+ container :
100+ image : amd64/rust
101+ steps :
102+ - uses : actions/checkout@v3
103+ with :
104+ submodules : true
105+ - name : Setup Rust toolchain
106+ uses : ./.github/actions/setup-builder
107+ with :
108+ rust-version : stable
103109 - name : Run examples
104110 run : |
105- export PATH=$PATH:$HOME/d/protoc/bin
106111 # test datafusion-sql examples
107112 cargo run --example sql
108113 # test datafusion-examples
@@ -122,17 +127,34 @@ jobs:
122127 - name : Verify Working Directory Clean
123128 run : git diff --exit-code
124129
130+ # Run doc tests
131+ linux-test-doc :
132+ name : cargo doctest (amd64)
133+ needs : [ linux-build-lib ]
134+ runs-on : ubuntu-latest
135+ container :
136+ image : amd64/rust
137+ steps :
138+ - uses : actions/checkout@v3
139+ with :
140+ submodules : true
141+ - name : Setup Rust toolchain
142+ uses : ./.github/actions/setup-builder
143+ with :
144+ rust-version : stable
145+ # Note: this does not include dictionary_expressions to reduce codegen
146+ - name : Run doctests
147+ run : cargo test --doc --features avro,jit,scheduler,json
148+ - name : Verify Working Directory Clean
149+ run : git diff --exit-code
150+
125151 # verify that the benchmark queries return the correct results
126152 verify-benchmark-results :
127153 name : verify benchmark results (amd64)
128- needs : [linux-build-lib]
154+ needs : [ linux-build-lib ]
129155 runs-on : ubuntu-latest
130156 container :
131157 image : amd64/rust
132- env :
133- # Disable full debug symbol generation to speed up CI build and keep memory down
134- # "1" means line tables only, which is useful for panic tracebacks.
135- RUSTFLAGS : " -C debuginfo=1"
136158 steps :
137159 - uses : actions/checkout@v3
138160 with :
@@ -166,7 +188,7 @@ jobs:
166188
167189 integration-test :
168190 name : " Compare to postgres"
169- needs : [linux-build-lib]
191+ needs : [ linux-build-lib ]
170192 runs-on : ubuntu-latest
171193 services :
172194 postgres :
@@ -230,7 +252,7 @@ jobs:
230252
231253 sqllogictest-postgres :
232254 name : " Run sqllogictest with Postgres runner"
233- needs : [linux-build-lib]
255+ needs : [ linux-build-lib ]
234256 runs-on : ubuntu-latest
235257 services :
236258 postgres :
@@ -327,14 +349,10 @@ jobs:
327349
328350 test-datafusion-pyarrow :
329351 name : cargo test pyarrow (amd64)
330- needs : [linux-build-lib]
352+ needs : [ linux-build-lib ]
331353 runs-on : ubuntu-20.04
332354 container :
333355 image : amd64/rust
334- env :
335- # Disable full debug symbol generation to speed up CI build and keep memory down
336- # "1" means line tables only, which is useful for panic tracebacks.
337- RUSTFLAGS : " -C debuginfo=1"
338356 steps :
339357 - uses : actions/checkout@v3
340358 with :
@@ -356,10 +374,9 @@ jobs:
356374 uses : ./.github/actions/setup-builder
357375 with :
358376 rust-version : stable
359- - name : Run tests
360- run : |
361- cd datafusion
362- cargo test --features=pyarrow
377+ - name : Run datafusion-common tests
378+ run : cargo test -p datafusion-common --features=pyarrow
379+
363380
364381 check-fmt :
365382 name : Check cargo fmt
@@ -368,11 +385,10 @@ jobs:
368385 image : amd64/rust
369386 steps :
370387 - uses : actions/checkout@v3
371- - name : Setup toolchain
372- run : |
373- rustup toolchain install stable
374- rustup default stable
375- rustup component add rustfmt
388+ - name : Setup Rust toolchain
389+ uses : ./.github/actions/setup-builder
390+ with :
391+ rust-version : stable
376392 - name : Run
377393 run : |
378394 echo '' > datafusion/proto/src/generated/datafusion.rs
@@ -422,14 +438,10 @@ jobs:
422438
423439 clippy :
424440 name : clippy
425- needs : [linux-build-lib]
441+ needs : [ linux-build-lib ]
426442 runs-on : ubuntu-latest
427443 container :
428444 image : amd64/rust
429- env :
430- # Disable full debug symbol generation to speed up CI build and keep memory down
431- # "1" means line tables only, which is useful for panic tracebacks.
432- RUSTFLAGS : " -C debuginfo=1"
433445 steps :
434446 - uses : actions/checkout@v3
435447 with :
@@ -445,22 +457,17 @@ jobs:
445457 with :
446458 rust-version : stable
447459 - name : Install Clippy
448- run : |
449- rustup component add clippy
460+ run : rustup component add clippy
450461 - name : Run clippy
451462 run : ci/scripts/rust_clippy.sh
452463
453464 # Check answers are correct when hash values collide
454465 hash-collisions :
455466 name : cargo test hash collisions (amd64)
456- needs : [linux-build-lib]
467+ needs : [ linux-build-lib ]
457468 runs-on : ubuntu-latest
458469 container :
459470 image : amd64/rust
460- env :
461- # Disable full debug symbol generation to speed up CI build and keep memory down
462- # "1" means line tables only, which is useful for panic tracebacks.
463- RUSTFLAGS : " -C debuginfo=1"
464471 steps :
465472 - uses : actions/checkout@v3
466473 with :
@@ -478,19 +485,14 @@ jobs:
478485 - name : Run tests
479486 run : |
480487 cd datafusion
481- # Force all hash values to collide
482- cargo test --all --features=force_hash_collisions
488+ cargo test --lib --tests --features=force_hash_collisions
483489
484490 cargo-toml-formatting-checks :
485491 name : check Cargo.toml formatting
486- needs : [linux-build-lib]
492+ needs : [ linux-build-lib ]
487493 runs-on : ubuntu-latest
488494 container :
489495 image : amd64/rust
490- env :
491- # Disable full debug symbol generation to speed up CI build and keep memory down
492- # "1" means line tables only, which is useful for panic tracebacks.
493- RUSTFLAGS : " -C debuginfo=1"
494496 steps :
495497 - uses : actions/checkout@v3
496498 with :
@@ -506,8 +508,8 @@ jobs:
506508 with :
507509 rust-version : stable
508510 - name : Install cargo-tomlfmt
509- run : |
510- which cargo-tomlfmt || cargo install cargo-tomlfmt
511+ run : which cargo-tomlfmt || cargo install cargo-tomlfmt
512+
511513 - name : Check Cargo.toml formatting
512514 run : |
513515 # if you encounter error, try rerun the command below, finally run 'git diff' to
@@ -519,14 +521,10 @@ jobs:
519521
520522 config-docs-check :
521523 name : check configs.md is up-to-date
522- needs : [linux-build-lib]
524+ needs : [ linux-build-lib ]
523525 runs-on : ubuntu-latest
524526 container :
525527 image : amd64/rust
526- env :
527- # Disable full debug symbol generation to speed up CI build and keep memory down
528- # "1" means line tables only, which is useful for panic tracebacks.
529- RUSTFLAGS : " -C debuginfo=1"
530528 steps :
531529 - uses : actions/checkout@v3
532530 with :
0 commit comments