From c1a4c6213101bb19680a6775e4d2df6a98b8bdc1 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Tue, 20 Oct 2026 13:48:58 +0300 Subject: [PATCH 1/2] ci(buildkite): skip native jobs when only docs/website/workflows changed The 6 native jobs take ~2.5h on a single agent. Changes limited to docs/, website/, .github/, .claude/ or *.md cannot affect them. Any other path, an empty diff or a failed diff runs the full matrix. --- .buildkite/pipeline.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index 10b5c4872a..edbf7c27a3 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -1,7 +1,26 @@ #!/bin/bash -e +# Native jobs take ~2.5h on a single agent, so skip them when the change cannot affect them. +# Anything unexpected (diff failed, empty diff, any other path touched) runs the full matrix. +# Master has no PR base: compare with the previous commit (squash merges keep it to one PR). +SKIP_PATHS='^(docs/|website/|\.github/|\.claude/|.*\.md$|LICENSE$)' + +if [ -n "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" ]; then + changed=$(git diff --name-only "origin/$BUILDKITE_PULL_REQUEST_BASE_BRANCH...HEAD" 2>/dev/null) || changed="" +else + changed=$(git diff --name-only HEAD~1 HEAD 2>/dev/null) || changed="" +fi + echo "steps:" +if [ -n "$changed" ] && ! echo "$changed" | grep -qvE "$SKIP_PATHS"; then + cat <<'YAML' + - label: ":fast_forward: Native CI skipped (docs/website/workflows only)" + command: "echo 'Only non-native paths changed, see .buildkite/pipeline.sh'" +YAML + exit 0 +fi + cat .buildkite/jobs/pipeline.android_rn_78.yml cat .buildkite/jobs/pipeline.android_rn_84.yml cat .buildkite/jobs/pipeline.android_rn_85.yml From 32b313810969b20c7cb515cdb7f3e3274495b9ef Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Tue, 20 Oct 2026 13:51:11 +0300 Subject: [PATCH 2/2] ci(buildkite): on master skip native jobs only if the previous commit is green --- .buildkite/pipeline.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index edbf7c27a3..6e68512bec 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -2,18 +2,22 @@ # Native jobs take ~2.5h on a single agent, so skip them when the change cannot affect them. # Anything unexpected (diff failed, empty diff, any other path touched) runs the full matrix. -# Master has no PR base: compare with the previous commit (squash merges keep it to one PR). +# Master has no PR base: compare with the previous commit and skip only if that commit is green, +# so a skipped (green) build never hides a red or cancelled predecessor. SKIP_PATHS='^(docs/|website/|\.github/|\.claude/|.*\.md$|LICENSE$)' +prev_ok=1 if [ -n "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" ]; then changed=$(git diff --name-only "origin/$BUILDKITE_PULL_REQUEST_BASE_BRANCH...HEAD" 2>/dev/null) || changed="" else changed=$(git diff --name-only HEAD~1 HEAD 2>/dev/null) || changed="" + prev_status=$(curl -fsS --max-time 10 "https://api.github.com/repos/wix/react-native-navigation/commits/$(git rev-parse HEAD~1)/status" 2>/dev/null | sed -n 's/^ "state": "\([a-z]*\)".*/\1/p' | head -1) + [ "$prev_status" = "success" ] || prev_ok=0 fi echo "steps:" -if [ -n "$changed" ] && ! echo "$changed" | grep -qvE "$SKIP_PATHS"; then +if [ "$prev_ok" = 1 ] && [ -n "$changed" ] && ! echo "$changed" | grep -qvE "$SKIP_PATHS"; then cat <<'YAML' - label: ":fast_forward: Native CI skipped (docs/website/workflows only)" command: "echo 'Only non-native paths changed, see .buildkite/pipeline.sh'"