Skip to content

Commit 3c021ac

Browse files
authored
Always run CI checks (#17538)
* Always run CI checks * Add `pre-job` * For `config-docs-check`, we don't need pre-job * Comments * keep `branches-ignore`
1 parent d2f8fa5 commit 3c021ac

File tree

2 files changed

+103
-29
lines changed

2 files changed

+103
-29
lines changed

.asf.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ github:
5050
main:
5151
required_pull_request_reviews:
5252
required_approving_review_count: 1
53+
required_status_checks:
54+
contexts:
55+
- "Check License Header"
56+
- "Use prettier to check formatting of documents"
57+
- "check-files"
58+
# This job marks steps in `.github/workflows/rust.yml` as required
59+
- "Validate Rust Required Checks"
5360
# needs to be updated as part of the release process
5461
# .asf.yaml doesn't support wildcard branch protection rules, only exact branch names
5562
# https://github.com/apache/infrastructure-asfyaml?tab=readme-ov-file#branch-protection

.github/workflows/rust.yml

Lines changed: 96 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,35 @@ on:
2525
push:
2626
branches-ignore:
2727
- 'gh-readonly-queue/**'
28-
paths-ignore:
29-
- "docs/**"
30-
- "**.md"
31-
- ".github/ISSUE_TEMPLATE/**"
32-
- ".github/pull_request_template.md"
3328
pull_request:
34-
paths-ignore:
35-
- "docs/**"
36-
- "**.md"
37-
- ".github/ISSUE_TEMPLATE/**"
38-
- ".github/pull_request_template.md"
3929
merge_group:
4030
# manual trigger
4131
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
32+
#
33+
# Note, we use merge queue for this repo. If you'd like to add a new "required" check, that should be checked before
34+
# the PR is merged, you should add your step to `rust-required-checks`
4235
workflow_dispatch:
4336

4437
jobs:
38+
# This job checks if heavy-weight jobs can be skipped, because only doc or non-code files were changed
39+
# More on this: https://github.com/orgs/community/discussions/45899
40+
pre-job:
41+
runs-on: ubuntu-latest
42+
outputs:
43+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
44+
steps:
45+
- id: skip_check
46+
uses: fkirc/skip-duplicate-actions@v5
47+
with:
48+
concurrent_skipping: 'never'
49+
skip_after_successful_duplicate: 'false'
50+
paths_ignore: '["**.md", "docs/**", ".github/ISSUE_TEMPLATE/**", ".github/pull_request_template.md"]'
51+
4552
# Check crate compiles and base cargo check passes
4653
linux-build-lib:
4754
name: linux build test
55+
needs: pre-job
56+
if: needs.pre-job.outputs.should_skip != 'true'
4857
runs-on: ubuntu-latest
4958
container:
5059
image: amd64/rust
@@ -72,7 +81,8 @@ jobs:
7281
# subset of the features packages enabled.
7382
linux-datafusion-common-features:
7483
name: cargo check datafusion-common features
75-
needs: linux-build-lib
84+
needs: [linux-build-lib, pre-job]
85+
if: needs.pre-job.outputs.should_skip != 'true'
7686
runs-on: ubuntu-latest
7787
container:
7888
image: amd64/rust
@@ -97,7 +107,8 @@ jobs:
97107
# subset of the features packages enabled.
98108
linux-datafusion-substrait-features:
99109
name: cargo check datafusion-substrait features
100-
needs: linux-build-lib
110+
needs: [linux-build-lib, pre-job]
111+
if: needs.pre-job.outputs.should_skip != 'true'
101112
runs-on: ubuntu-latest
102113
container:
103114
image: amd64/rust
@@ -134,7 +145,8 @@ jobs:
134145
# subset of the features packages enabled.
135146
linux-datafusion-proto-features:
136147
name: cargo check datafusion-proto features
137-
needs: linux-build-lib
148+
needs: [linux-build-lib, pre-job]
149+
if: needs.pre-job.outputs.should_skip != 'true'
138150
runs-on: ubuntu-latest
139151
container:
140152
image: amd64/rust
@@ -165,7 +177,8 @@ jobs:
165177
# subset of the features packages enabled.
166178
linux-cargo-check-datafusion:
167179
name: cargo check datafusion features
168-
needs: linux-build-lib
180+
needs: [linux-build-lib, pre-job]
181+
if: needs.pre-job.outputs.should_skip != 'true'
169182
runs-on: ubuntu-latest
170183
container:
171184
image: amd64/rust
@@ -232,7 +245,8 @@ jobs:
232245
# subset of the features packages enabled.
233246
linux-cargo-check-datafusion-functions:
234247
name: cargo check datafusion-functions features
235-
needs: linux-build-lib
248+
needs: [linux-build-lib, pre-job]
249+
if: needs.pre-job.outputs.should_skip != 'true'
236250
runs-on: ubuntu-latest
237251
container:
238252
image: amd64/rust
@@ -267,7 +281,8 @@ jobs:
267281
# Library and integration tests
268282
linux-test:
269283
name: cargo test (amd64)
270-
needs: linux-build-lib
284+
needs: [linux-build-lib, pre-job]
285+
if: needs.pre-job.outputs.should_skip != 'true'
271286
runs-on: ubuntu-latest
272287
container:
273288
image: amd64/rust
@@ -283,8 +298,8 @@ jobs:
283298
- name: Rust Dependency Cache
284299
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
285300
with:
286-
save-if: ${{ github.ref_name == 'main' }}
287-
shared-key: "amd-ci"
301+
save-if: ${{ github.ref_name == 'main' }}
302+
shared-key: "amd-ci"
288303
- name: Run tests (excluding doctests and datafusion-cli)
289304
env:
290305
RUST_BACKTRACE: 1
@@ -306,7 +321,8 @@ jobs:
306321
# datafusion-cli tests
307322
linux-test-datafusion-cli:
308323
name: cargo test datafusion-cli (amd64)
309-
needs: linux-build-lib
324+
needs: [linux-build-lib, pre-job]
325+
if: needs.pre-job.outputs.should_skip != 'true'
310326
runs-on: ubuntu-latest
311327
# should be uncommented once https://github.com/apache/datafusion/pull/16644 is merged
312328
# and cache should be added
@@ -334,7 +350,8 @@ jobs:
334350

335351
linux-test-example:
336352
name: cargo examples (amd64)
337-
needs: linux-build-lib
353+
needs: [linux-build-lib, pre-job]
354+
if: needs.pre-job.outputs.should_skip != 'true'
338355
runs-on: ubuntu-latest
339356
container:
340357
image: amd64/rust
@@ -364,7 +381,8 @@ jobs:
364381
# Run `cargo test doc` (test documentation examples)
365382
linux-test-doc:
366383
name: cargo test doc (amd64)
367-
needs: linux-build-lib
384+
needs: [linux-build-lib, pre-job]
385+
if: needs.pre-job.outputs.should_skip != 'true'
368386
runs-on: ubuntu-latest
369387
container:
370388
image: amd64/rust
@@ -385,7 +403,8 @@ jobs:
385403
# Run `cargo doc` to ensure the rustdoc is clean
386404
linux-rustdoc:
387405
name: cargo doc
388-
needs: linux-build-lib
406+
needs: [linux-build-lib, pre-job]
407+
if: needs.pre-job.outputs.should_skip != 'true'
389408
runs-on: ubuntu-latest
390409
container:
391410
image: amd64/rust
@@ -423,7 +442,8 @@ jobs:
423442
# verify that the benchmark queries return the correct results
424443
verify-benchmark-results:
425444
name: verify benchmark results (amd64)
426-
needs: linux-build-lib
445+
needs: [linux-build-lib, pre-job]
446+
if: needs.pre-job.outputs.should_skip != 'true'
427447
runs-on: ubuntu-latest
428448
container:
429449
image: amd64/rust
@@ -456,7 +476,8 @@ jobs:
456476

457477
sqllogictest-postgres:
458478
name: "Run sqllogictest with Postgres runner"
459-
needs: linux-build-lib
479+
needs: [linux-build-lib, pre-job]
480+
if: needs.pre-job.outputs.should_skip != 'true'
460481
runs-on: ubuntu-latest
461482
container:
462483
image: amd64/rust
@@ -494,7 +515,8 @@ jobs:
494515

495516
sqllogictest-substrait:
496517
name: "Run sqllogictest in Substrait round-trip mode"
497-
needs: linux-build-lib
518+
needs: [linux-build-lib, pre-job]
519+
if: needs.pre-job.outputs.should_skip != 'true'
498520
runs-on: ubuntu-latest
499521
container:
500522
image: amd64/rust
@@ -565,7 +587,8 @@ jobs:
565587

566588
test-datafusion-pyarrow:
567589
name: cargo test pyarrow (amd64)
568-
needs: linux-build-lib
590+
needs: [linux-build-lib, pre-job]
591+
if: needs.pre-job.outputs.should_skip != 'true'
569592
runs-on: ubuntu-latest
570593
container:
571594
image: amd64/rust:bullseye # Use the bullseye tag image which comes with python3.9
@@ -589,6 +612,8 @@ jobs:
589612

590613
vendor:
591614
name: Verify Vendored Code
615+
needs: pre-job
616+
if: needs.pre-job.outputs.should_skip != 'true'
592617
runs-on: ubuntu-latest
593618
container:
594619
image: amd64/rust
@@ -606,6 +631,8 @@ jobs:
606631

607632
check-fmt:
608633
name: Check cargo fmt
634+
needs: pre-job
635+
if: needs.pre-job.outputs.should_skip != 'true'
609636
runs-on: ubuntu-latest
610637
container:
611638
image: amd64/rust
@@ -664,7 +691,8 @@ jobs:
664691

665692
clippy:
666693
name: clippy
667-
needs: linux-build-lib
694+
needs: [linux-build-lib, pre-job]
695+
if: needs.pre-job.outputs.should_skip != 'true'
668696
runs-on: ubuntu-latest
669697
container:
670698
image: amd64/rust
@@ -689,7 +717,8 @@ jobs:
689717

690718
cargo-toml-formatting-checks:
691719
name: check Cargo.toml formatting
692-
needs: linux-build-lib
720+
needs: [linux-build-lib, pre-job]
721+
if: needs.pre-job.outputs.should_skip != 'true'
693722
runs-on: ubuntu-latest
694723
container:
695724
image: amd64/rust
@@ -710,7 +739,8 @@ jobs:
710739

711740
config-docs-check:
712741
name: check configs.md and ***_functions.md is up-to-date
713-
needs: linux-build-lib
742+
needs: [linux-build-lib]
743+
if: needs.pre-job.outputs.should_skip != 'true'
714744
runs-on: ubuntu-latest
715745
container:
716746
image: amd64/rust
@@ -744,6 +774,8 @@ jobs:
744774
# - datafusion-cli
745775
msrv:
746776
name: Verify MSRV (Min Supported Rust Version)
777+
needs: [pre-job]
778+
if: needs.pre-job.outputs.should_skip != 'true'
747779
runs-on: ubuntu-latest
748780
container:
749781
image: amd64/rust
@@ -792,9 +824,44 @@ jobs:
792824
run: cargo msrv --output-format json --log-target stdout verify
793825
typos:
794826
name: Spell Check with Typos
827+
needs: [pre-job]
828+
if: needs.pre-job.outputs.should_skip != 'true'
795829
runs-on: ubuntu-latest
796830
steps:
797831
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
798832
with:
799833
persist-credentials: false
800834
- uses: crate-ci/typos@v1
835+
836+
rust-required-checks:
837+
name: Validate Rust Required Checks
838+
needs: [ linux-rustdoc,
839+
linux-wasm-pack,
840+
linux-build-lib,
841+
macos-aarch64,
842+
vendor,
843+
check-fmt,
844+
msrv,
845+
linux-datafusion-common-features,
846+
linux-datafusion-substrait-features,
847+
linux-datafusion-proto-features,
848+
linux-cargo-check-datafusion,
849+
linux-cargo-check-datafusion-functions,
850+
linux-test,
851+
linux-test-example,
852+
linux-test-doc,
853+
verify-benchmark-results,
854+
sqllogictest-postgres,
855+
sqllogictest-substrait,
856+
test-datafusion-pyarrow,
857+
clippy,
858+
cargo-toml-formatting-checks,
859+
linux-test-datafusion-cli,
860+
config-docs-check
861+
]
862+
if: always()
863+
runs-on: ubuntu-latest
864+
steps:
865+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
866+
- run: echo '${{ toJSON(needs) }}' | jq -e 'all(.[]; .result == "success" or .result == "skipped")'
867+

0 commit comments

Comments
 (0)