forked from apache/datafusion
-
Notifications
You must be signed in to change notification settings - Fork 1
768 lines (735 loc) · 28.6 KB
/
rust.yml
File metadata and controls
768 lines (735 loc) · 28.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# 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.
name: Rust
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
on:
push:
paths-ignore:
- "docs/**"
- "**.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/pull_request_template.md"
pull_request:
paths-ignore:
- "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:
jobs:
# Check license header
license-header-check:
runs-on: ubuntu-latest
name: Check License Header
steps:
- uses: actions/checkout@v4
- uses: korandoru/hawkeye@v6
# Check crate compiles and base cargo check passes
linux-build-lib:
name: linux build test
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Prepare cargo build
run: |
# Adding `--locked` here to assert that the `Cargo.lock` file is up to
# date with the manifest. When this fails, please make sure to commit
# the changes to `Cargo.lock` after building with the updated manifest.
cargo check --profile ci --workspace --all-targets --features integration-tests --locked
# 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion-common (default features)
run: cargo check --profile ci --all-targets -p datafusion-common
#
# Note: Only check libraries (not --all-targets) to cover end user APIs
#
- name: Check datafusion-common (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion-common
# 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion-substrait (default features)
run: cargo check --profile ci --all-targets -p datafusion-substrait
#
# Note: Only check libraries (not --all-targets) to cover end user APIs
#
- name: Check datafusion-substrait (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion-substrait
- name: Check datafusion-substrait (physical)
run: cargo check --profile ci --no-default-features -p datafusion-substrait --features=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 check --profile ci --no-default-features -p datafusion-substrait --features=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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion-proto (default features)
run: cargo check --profile ci --all-targets -p datafusion-proto
#
# Note: Only check libraries (not --all-targets) to cover end user APIs
#
- name: Check datafusion-proto (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion-proto
- name: Check datafusion-proto (json)
run: cargo check --profile ci --no-default-features -p datafusion-proto --features=json
- name: Check datafusion-proto (parquet)
run: cargo check --profile ci --no-default-features -p datafusion-proto --features=parquet
- name: Check datafusion-proto (avro)
run: cargo check --profile ci --no-default-features -p datafusion-proto --features=avro
# 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion (default features)
run: cargo check --profile ci --all-targets -p datafusion
#
# Note: Only check libraries (not --all-targets) to cover end user APIs
#
- name: Check datafusion (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion
- name: Check datafusion (nested_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=nested_expressions
- name: Check datafusion (array_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=array_expressions
- name: Check datafusion (avro)
run: cargo check --profile ci --no-default-features -p datafusion --features=avro
- name: Check datafusion (backtrace)
run: cargo check --profile ci --no-default-features -p datafusion --features=backtrace
- name: Check datafusion (compression)
run: cargo check --profile ci --no-default-features -p datafusion --features=compression
- name: Check datafusion (crypto_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=crypto_expressions
- name: Check datafusion (datetime_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=datetime_expressions
- name: Check datafusion (encoding_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=encoding_expressions
- name: Check datafusion (force_hash_collisions)
run: cargo check --profile ci --no-default-features -p datafusion --features=force_hash_collisions
- name: Check datafusion (math_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=math_expressions
- name: Check datafusion (parquet)
run: cargo check --profile ci --no-default-features -p datafusion --features=parquet
- name: Check datafusion (pyarrow)
run: cargo check --profile ci --no-default-features -p datafusion --features=pyarrow
- name: Check datafusion (regex_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=regex_expressions
- name: Check datafusion (recursive_protection)
run: cargo check --profile ci --no-default-features -p datafusion --features=recursive_protection
- name: Check datafusion (serde)
run: cargo check --profile ci --no-default-features -p datafusion --features=serde
- name: Check datafusion (string_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=string_expressions
- name: Check datafusion (unicode_expressions)
run: cargo check --profile ci --no-default-features -p datafusion --features=unicode_expressions
# 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Check datafusion-functions (default features)
run: cargo check --profile ci --all-targets -p datafusion-functions
#
# Note: Only check libraries (not --all-targets) to cover end user APIs
#
- name: Check datafusion-functions (no-default-features)
run: cargo check --profile ci --no-default-features -p datafusion-functions
- name: Check datafusion-functions (crypto_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=crypto_expressions
- name: Check datafusion-functions (datetime_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=datetime_expressions
- name: Check datafusion-functions (encoding_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=encoding_expressions
- name: Check datafusion-functions (math_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=math_expressions
- name: Check datafusion-functions (regex_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=regex_expressions
- name: Check datafusion-functions (string_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=string_expressions
- name: Check datafusion-functions (unicode_expressions)
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=unicode_expressions
# Library and integration tests
linux-test:
name: cargo test (amd64)
needs: linux-build-lib
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
run: rustup toolchain install stable
- name: Install Protobuf Compiler
run: sudo apt-get install -y protobuf-compiler
- name: Run tests (excluding doctests and datafusion-cli)
env:
RUST_BACKTRACE: 1
run: |
cargo test \
--profile ci \
--exclude datafusion-examples \
--exclude ffi_example_table_provider \
--exclude datafusion-benchmarks \
--exclude datafusion-cli \
--workspace \
--lib \
--tests \
--bins \
--features serde,avro,json,backtrace,integration-tests
- name: Verify Working Directory Clean
run: git diff --exit-code
# datafusion-cli tests
linux-test-datafusion-cli:
name: cargo test datafusion-cli (amd64)
needs: linux-build-lib
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
run: rustup toolchain install stable
- name: Setup Minio - S3-compatible storage
run: |
docker run -d --name minio-container \
-p 9000:9000 \
-e MINIO_ROOT_USER=TEST-DataFusionLogin -e MINIO_ROOT_PASSWORD=TEST-DataFusionPassword \
-v $(pwd)/datafusion/core/tests/data:/source quay.io/minio/minio \
server /data
docker exec minio-container /bin/sh -c "\
mc ready local
mc alias set localminio http://localhost:9000 TEST-DataFusionLogin TEST-DataFusionPassword && \
mc mb localminio/data && \
mc cp -r /source/* localminio/data"
- 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 test --profile ci -p datafusion-cli --lib --tests --bins
- name: Verify Working Directory Clean
run: git diff --exit-code
- name: Minio Output
if: ${{ !cancelled() }}
run: docker logs minio-container
linux-test-example:
name: cargo examples (amd64)
needs: linux-build-lib
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Run doctests
run: cargo test --profile ci --doc --features avro,json
- 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- 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
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup for wasm32
run: |
rustup target add wasm32-unknown-unknown
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq clang
- name: Setup wasm-pack
run: |
cargo install wasm-pack
- name: Run tests with headless mode
working-directory: ./datafusion/wasmtest
run: |
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack test --headless --firefox
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- 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: |
# increase stack size to fix stack overflow
export RUST_MIN_STACK=20971520
export TPCH_DATA=`realpath datafusion/sqllogictest/test_files/tpch/data`
cargo test plan_q --package datafusion-benchmarks --profile ci --features=ci -- --test-threads=1
INCLUDE_TPCH=true cargo test --features backtrace --profile ci --package datafusion-sqllogictest --test sqllogictests
- name: Verify Working Directory Clean
run: git diff --exit-code
sqllogictest-postgres:
name: "Run sqllogictest with Postgres runner"
needs: linux-build-lib
runs-on: 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: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Run sqllogictest
run: |
cd datafusion/sqllogictest
PG_COMPAT=true PG_URI="postgresql://postgres:postgres@$POSTGRES_HOST:$POSTGRES_PORT/db_test" cargo test --features backtrace --profile ci --features=postgres --test sqllogictests
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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
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 it for just one that works (limit.slt)
# 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 test --test sqllogictests -- --substrait-round-trip limit.slt
# 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
# Commenting out intel mac build as so few users would ever use it
# Details: https://github.com/apache/datafusion/issues/13846
# macos:
# name: cargo test (macos)
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# fetch-depth: 1
# - name: Setup Rust toolchain
# uses: ./.github/actions/setup-macos-builder
# - name: Run tests (excluding doctests)
# shell: bash
# run: cargo test run --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --workspace --lib --tests --bins --features avro,json,backtrace
macos-aarch64:
name: cargo test (macos-aarch64)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-macos-aarch64-builder
- name: Run tests (excluding doctests)
shell: bash
run: cargo test --profile ci --exclude datafusion-cli --workspace --lib --tests --bins --features avro,json,backtrace,integration-tests
test-datafusion-pyarrow:
name: cargo test pyarrow (amd64)
needs: linux-build-lib
runs-on: ubuntu-latest
container:
image: amd64/rust:bullseye # Use the bullseye tag image which comes with python3.9
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Install PyArrow
run: |
echo "LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
apt-get update
apt-get install python3-pip -y
python3 -m pip install pyarrow
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Run datafusion-common tests
run: cargo test --profile ci -p datafusion-common --features=pyarrow
vendor:
name: Verify Vendored Code
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Run
run: |
echo '' > datafusion/proto/src/generated/datafusion.rs
ci/scripts/rust_fmt.sh
# Coverage job disabled due to
# https://github.com/apache/datafusion/issues/3678
# coverage:
# name: coverage
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Install protobuf compiler
# shell: bash
# run: |
# mkdir -p $HOME/d/protoc
# cd $HOME/d/protoc
# export PROTO_ZIP="protoc-21.4-linux-x86_64.zip"
# curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP
# unzip $PROTO_ZIP
# export PATH=$PATH:$HOME/d/protoc/bin
# protoc --version
# - name: Setup Rust toolchain
# run: |
# rustup toolchain install stable
# rustup default stable
# rustup component add rustfmt clippy
# - name: Cache Cargo
# uses: actions/cache@v4
# with:
# path: /home/runner/.cargo
# # this key is not equal because the user is different than on a container (runner vs github)
# key: cargo-coverage-cache3-
# - name: Run coverage
# run: |
# export PATH=$PATH:$HOME/d/protoc/bin
# rustup toolchain install stable
# rustup default stable
# cargo install --version 0.20.1 cargo-tarpaulin
# cargo tarpaulin --all --out Xml
# - name: Report coverage
# continue-on-error: true
# run: bash <(curl -s https://codecov.io/bash)
clippy:
name: clippy
needs: linux-build-lib
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Install Clippy
run: rustup component add clippy
- name: Run clippy
run: ci/scripts/rust_clippy.sh
cargo-toml-formatting-checks:
name: check Cargo.toml formatting
needs: linux-build-lib
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- name: Install taplo
run: cargo +stable install taplo-cli --version ^0.9 --locked
# 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
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
- uses: actions/setup-node@v4
with:
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
./dev/update_config_docs.sh
git diff --exit-code
- name: Check if any of the ***_functions.md has been modified
run: |
# If you encounter an error, run './dev/update_function_docs.sh' and commit
./dev/update_function_docs.sh
git diff --exit-code
- name: Check if runtime_configs.md has been modified
run: |
# If you encounter an error, run './dev/update_runtime_config_docs.sh' and commit
./dev/update_runtime_config_docs.sh
git diff --exit-code
# 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)
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
- name: Install cargo-msrv
run: cargo install 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. Example:
# rustup install 1.80.1
# 2. Run the command that failed with that version. Example:
# cargo +1.80.1 check -p datafusion
#
# 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