Skip to content

Commit 10e98a6

Browse files
committed
fix(ci): Include sample app and perf test changes in step-level platform gates
The step-level platform-check in sample-application, sample-application-expo, and e2e-v2 workflows gated on needs_ios/needs_android, which only track SDK source and native code changes. When only sample app or performance test files changed, the job-level condition correctly triggered (via needs_sample_react_native, needs_sample_expo), but every platform step was skipped — runners allocated, zero meaningful work done, false green reported. Fix by checking sample_react_native/sample_expo/perf_tests as the first condition in each platform-check step. If the relevant files changed, all platforms proceed without skipping. Affected workflows: - sample-application.yml: build and test jobs (sample_react_native) - sample-application-expo.yml: build job (sample_expo) - e2e-v2.yml: metrics job (perf_tests)
1 parent 9972c54 commit 10e98a6

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.github/workflows/e2e-v2.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ jobs:
6565
- name: Check if platform is needed
6666
id: platform-check
6767
run: |
68-
if [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
68+
# Performance test changes should always run metrics (that's the
69+
# whole point). The needs_ios/needs_android flags only track SDK
70+
# source & native code — not performance-tests/** files.
71+
PERF_CHANGED="${{ needs.detect-changes.outputs.perf_tests }}"
72+
73+
if [[ "$PERF_CHANGED" == "true" ]]; then
74+
echo "skip=false" >> "$GITHUB_OUTPUT"
75+
echo "Performance tests changed — running metrics for ${{ matrix.platform }}."
76+
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
6977
echo "skip=true" >> "$GITHUB_OUTPUT"
7078
echo "Skipping iOS — no relevant changes detected."
7179
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then

.github/workflows/sample-application-expo.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ jobs:
6262
- name: Check if platform is needed
6363
id: platform-check
6464
run: |
65-
if [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
65+
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_expo }}"
66+
67+
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
68+
echo "skip=false" >> "$GITHUB_OUTPUT"
69+
echo "Sample app changed — building ${{ matrix.platform }}."
70+
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
6671
echo "skip=true" >> "$GITHUB_OUTPUT"
6772
echo "Skipping iOS — no relevant changes detected."
6873
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then

.github/workflows/sample-application.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,15 @@ jobs:
7777
- name: Check if platform is needed
7878
id: platform-check
7979
run: |
80-
if [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
80+
# Sample app changes should always build all platforms (that's the
81+
# whole point of this workflow). The needs_ios/needs_android flags
82+
# only track SDK source & native code — not sample app files.
83+
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_react_native }}"
84+
85+
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
86+
echo "skip=false" >> "$GITHUB_OUTPUT"
87+
echo "Sample app changed — building ${{ matrix.platform }}."
88+
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
8189
echo "skip=true" >> "$GITHUB_OUTPUT"
8290
echo "Skipping iOS — no relevant changes detected."
8391
elif [[ "${{ matrix.platform }}" == "macos" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
@@ -259,7 +267,12 @@ jobs:
259267
- name: Check if platform is needed
260268
id: platform-check
261269
run: |
262-
if [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
270+
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_react_native }}"
271+
272+
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
273+
echo "skip=false" >> "$GITHUB_OUTPUT"
274+
echo "Sample app changed — testing ${{ matrix.platform }}."
275+
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
263276
echo "skip=true" >> "$GITHUB_OUTPUT"
264277
echo "Skipping iOS — no relevant changes detected."
265278
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then

0 commit comments

Comments
 (0)