@@ -74,32 +74,16 @@ jobs:
7474 - ios-use-frameworks : ' dynamic-frameworks'
7575 platform : ' macos'
7676 steps :
77+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
78+
7779 - name : Check if platform is needed
7880 id : platform-check
79- run : |
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
89- echo "skip=true" >> "$GITHUB_OUTPUT"
90- echo "Skipping iOS — no relevant changes detected."
91- elif [[ "${{ matrix.platform }}" == "macos" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
92- echo "skip=true" >> "$GITHUB_OUTPUT"
93- echo "Skipping macOS — no relevant changes detected."
94- elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then
95- echo "skip=true" >> "$GITHUB_OUTPUT"
96- echo "Skipping Android — no relevant changes detected."
97- else
98- echo "skip=false" >> "$GITHUB_OUTPUT"
99- fi
100-
101- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
102- if : ${{ steps.platform-check.outputs.skip != 'true' }}
81+ uses : ./.github/actions/platform-check
82+ with :
83+ platform : ${{ matrix.platform }}
84+ sample_changed : ${{ needs.detect-changes.outputs.sample_react_native }}
85+ needs_ios : ${{ needs.detect-changes.outputs.needs_ios }}
86+ needs_android : ${{ needs.detect-changes.outputs.needs_android }}
10387
10488 - name : Enable Corepack (NPM)
10589 if : ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }}
@@ -264,26 +248,16 @@ jobs:
264248 build-type : ' production'
265249
266250 steps :
251+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
252+
267253 - name : Check if platform is needed
268254 id : platform-check
269- run : |
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
276- echo "skip=true" >> "$GITHUB_OUTPUT"
277- echo "Skipping iOS — no relevant changes detected."
278- elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then
279- echo "skip=true" >> "$GITHUB_OUTPUT"
280- echo "Skipping Android — no relevant changes detected."
281- else
282- echo "skip=false" >> "$GITHUB_OUTPUT"
283- fi
284-
285- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
286- if : ${{ steps.platform-check.outputs.skip != 'true' }}
255+ uses : ./.github/actions/platform-check
256+ with :
257+ platform : ${{ matrix.platform }}
258+ sample_changed : ${{ needs.detect-changes.outputs.sample_react_native }}
259+ needs_ios : ${{ needs.detect-changes.outputs.needs_ios }}
260+ needs_android : ${{ needs.detect-changes.outputs.needs_android }}
287261
288262 - name : Install Maestro
289263 if : ${{ steps.platform-check.outputs.skip != 'true' }}
0 commit comments