Apache DataFusion SQL Query Engine
ci: Skip macOS tests in forks (#27017)
Kosta Tarasov1635ed94742c
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.ymlindex bbee5900cd..ba9a8d528d 100644--- a/.github/workflows/rust.yml+++ b/.github/workflows/rust.yml@@ -50,7 +50,8 @@# # 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+# runners, except macOS, which runs upstream, including in the merge queue.+# `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,@@ -762,7 +763,7 @@ jobs:# 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') }}+ if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && github.base_ref == 'main') && !(github.repository != 'apache/datafusion') }}runs-on: macos-15steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1diff --git a/ci/scripts/check_rust_workflow_skips.py b/ci/scripts/check_rust_workflow_skips.pyindex 0d3393431c..ec96cf9f35 100755--- a/ci/scripts/check_rust_workflow_skips.py+++ b/ci/scripts/check_rust_workflow_skips.py@@ -6,7 +6,7 @@"""Validate the job-level skip conditions in rust.yml.-rust.yml skips jobs on two events. Each skip set below pairs a clause with+rust.yml skips jobs by event and repository. Each skip set below pairs a clause withthe jobs that carry it: a job's `if:` is exactly `!(clause)` for every setit belongs to, joined with ` && ` in the order of SKIP_POLICIES, and a jobin no set carries no job-level `if:`. A new job therefore runs everywhere@@ -95,9 +95,13 @@ FORK_PR_SKIPPED_JOBS = frozenset(})+FORK_REPOSITORY = "github.repository != 'apache/datafusion'"+FORK_REPO_SKIPPED_JOBS = frozenset({"macos-aarch64"})+SKIP_POLICIES = (("POST_MERGE_SKIPPED_JOBS", POST_MERGE_SKIPPED_JOBS, POST_MERGE_PUSH),("FORK_PR_SKIPPED_JOBS", FORK_PR_SKIPPED_JOBS, FORK_PULL_REQUEST),+ ("FORK_REPO_SKIPPED_JOBS", FORK_REPO_SKIPPED_JOBS, FORK_REPOSITORY),)@@ -183,9 +187,7 @@ def check_skip_conditions(workflow, required_checks):f" - job `{job}` is not in {set_name} but needs "f"{blocked}; GitHub would skip it with them")- # Only the merge queue gates a job that skips after the merge. A job- # that skips on a fork PR still runs on the fork, in the queue, and on- # main.+ # Only the merge queue gates a job that skips after the merge.if required_checks and set_name == "POST_MERGE_SKIPPED_JOBS":for job in sorted(members & set(jobs)):name = jobs[job].get("name", job)diff --git a/docs/source/contributor-guide/index.md b/docs/source/contributor-guide/index.mdindex 5df074618d..c71fa1ee13 100644--- a/docs/source/contributor-guide/index.md+++ b/docs/source/contributor-guide/index.md@@ -275,6 +275,9 @@ such a pull request and adds a `Rust (fork)` check that links to the run onyour fork. The merge queue runs the full workflow on the merged result beforea pull request merges, so a green fork run does not replace it.+macOS tests skip fork runs to avoid runner timeouts. They remain required in the+merge queue, and other upstream coverage is unchanged.+To make this work:1. Before you push your branch, open the **Actions** tab on your fork.