Skip to content

Commit fbd9a03

Browse files
Juanita-Dashclaude
andcommitted
Wire up React Native CI workflows
Adds six rn-*.yml reusable workflows under .github/workflows/, mirroring the source repo's CI surface and following the existing android-*/swift-* monorepo conventions (em-dash names, pinned action SHAs, workflow_call + workflow_dispatch triggers, working-directory: platforms/react-native, shop/setup-javascript-action for the JS toolchain). Jobs (ordered "tests first, lint last" to match the swift section): - rn-test jest (with coverage comment on PRs) - rn-test-android pnpm sample test:android (JDK 22 / Gradle) - rn-test-ios pnpm sample test:ios (vars.MACOS_RUNNER + cocoapods) - rn-license-headers ./scripts/copy_license --check - rn-check-packed-files module build + compare-snapshot - rn-lint SwiftLint + module build + module/sample eslint ci.yml: wires each new workflow into the orchestrator, extends the reactNative paths filter to watch the new files, and adds them to ci-required.needs so they participate in the aggregated status check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b0b150a commit fbd9a03

10 files changed

Lines changed: 384 additions & 3 deletions

File tree

.github/dependabot.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,54 @@ updates:
6363
apollo:
6464
patterns:
6565
- "com.apollographql.apollo*"
66+
67+
# React Native — root pnpm workspace
68+
- package-ecosystem: npm
69+
directory: "/platforms/react-native"
70+
schedule:
71+
interval: daily
72+
cooldown:
73+
default-days: 7
74+
ignore:
75+
- dependency-name: "*"
76+
update-types:
77+
- "version-update:semver-major"
78+
- "version-update:semver-minor"
79+
80+
# React Native — Checkout Sheet Kit module
81+
- package-ecosystem: npm
82+
directory: "/platforms/react-native/modules/@shopify/checkout-sheet-kit"
83+
schedule:
84+
interval: daily
85+
cooldown:
86+
default-days: 7
87+
ignore:
88+
- dependency-name: "*"
89+
update-types:
90+
- "version-update:semver-major"
91+
- "version-update:semver-minor"
92+
93+
# React Native — sample app
94+
- package-ecosystem: npm
95+
directory: "/platforms/react-native/sample"
96+
schedule:
97+
interval: daily
98+
cooldown:
99+
default-days: 7
100+
ignore:
101+
- dependency-name: "*"
102+
update-types:
103+
- "version-update:semver-major"
104+
105+
# React Native — sample iOS CocoaPods (via Bundler/Gemfile)
106+
- package-ecosystem: bundler
107+
directory: "/platforms/react-native/sample"
108+
schedule:
109+
interval: daily
110+
cooldown:
111+
default-days: 7
112+
ignore:
113+
- dependency-name: "*"
114+
update-types:
115+
- "version-update:semver-major"
116+
- "version-update:semver-minor"

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050
- '.github/workflows/ci.yml'
5151
reactNative:
5252
- 'platforms/react-native/**'
53+
- '.github/workflows/rn-test.yml'
54+
- '.github/workflows/rn-test-android.yml'
55+
- '.github/workflows/rn-test-ios.yml'
56+
- '.github/workflows/rn-license-headers.yml'
57+
- '.github/workflows/rn-check-packed-files.yml'
58+
- '.github/workflows/rn-lint.yml'
5359
- '.github/workflows/ci.yml'
5460
5561
android-test:
@@ -82,6 +88,45 @@ jobs:
8288
if: needs.changes.outputs.swift == 'true'
8389
uses: ./.github/workflows/swift-lint.yml
8490

91+
rn-test:
92+
name: React Native
93+
needs: changes
94+
if: needs.changes.outputs.reactNative == 'true'
95+
permissions:
96+
contents: read
97+
pull-requests: write
98+
uses: ./.github/workflows/rn-test.yml
99+
100+
rn-test-android:
101+
name: React Native
102+
needs: changes
103+
if: needs.changes.outputs.reactNative == 'true'
104+
uses: ./.github/workflows/rn-test-android.yml
105+
106+
rn-test-ios:
107+
name: React Native
108+
needs: changes
109+
if: needs.changes.outputs.reactNative == 'true'
110+
uses: ./.github/workflows/rn-test-ios.yml
111+
112+
rn-license-headers:
113+
name: React Native
114+
needs: changes
115+
if: needs.changes.outputs.reactNative == 'true'
116+
uses: ./.github/workflows/rn-license-headers.yml
117+
118+
rn-check-packed-files:
119+
name: React Native
120+
needs: changes
121+
if: needs.changes.outputs.reactNative == 'true'
122+
uses: ./.github/workflows/rn-check-packed-files.yml
123+
124+
rn-lint:
125+
name: React Native
126+
needs: changes
127+
if: needs.changes.outputs.reactNative == 'true'
128+
uses: ./.github/workflows/rn-lint.yml
129+
85130
# Single required status check for branch protection.
86131
# Passes when every relevant platform job either succeeded or was skipped
87132
# because no files in that platform's tree changed.
@@ -95,6 +140,12 @@ jobs:
95140
- swift-test-package
96141
- swift-build-samples
97142
- swift-lint
143+
- rn-test
144+
- rn-test-android
145+
- rn-test-ios
146+
- rn-license-headers
147+
- rn-check-packed-files
148+
- rn-lint
98149
runs-on: ubuntu-latest
99150
steps:
100151
- name: Verify all upstream jobs succeeded or were skipped
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: React Native — Check Packed Files
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
check-packed-files:
9+
name: Check package files
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
env:
13+
TERM: xterm
14+
defaults:
15+
run:
16+
working-directory: platforms/react-native
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
20+
- name: Setup Node.js and pnpm
21+
uses: shop/setup-javascript-action@main
22+
with:
23+
node-version-file: platforms/react-native/package.json
24+
cache-dependency-path: platforms/react-native/pnpm-lock.yaml
25+
26+
- name: Cache turbo build setup
27+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
28+
with:
29+
path: platforms/react-native/.turbo
30+
key: ${{ runner.os }}-turbo-${{ github.sha }}
31+
restore-keys: |
32+
${{ runner.os }}-turbo-
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Build module and compare snapshot
38+
run: |
39+
pnpm module clean
40+
pnpm module build
41+
pnpm compare-snapshot
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: React Native — Check License Headers
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
license:
9+
name: Verify license headers
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
defaults:
13+
run:
14+
working-directory: platforms/react-native
15+
steps:
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
18+
- name: Check license headers
19+
run: ./scripts/copy_license --check

.github/workflows/rn-lint.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: React Native — Lint
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
swiftlint:
9+
name: SwiftLint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
13+
- uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
14+
with:
15+
args: --strict
16+
17+
lint:
18+
name: Lint module + sample
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
defaults:
22+
run:
23+
working-directory: platforms/react-native
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- name: Setup Node.js and pnpm
28+
uses: shop/setup-javascript-action@main
29+
with:
30+
node-version-file: platforms/react-native/package.json
31+
cache-dependency-path: platforms/react-native/pnpm-lock.yaml
32+
33+
- name: Cache turbo build setup
34+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
35+
with:
36+
path: platforms/react-native/.turbo
37+
key: ${{ runner.os }}-turbo-${{ github.sha }}
38+
restore-keys: |
39+
${{ runner.os }}-turbo-
40+
41+
- name: Install dependencies
42+
run: pnpm install --frozen-lockfile
43+
44+
- name: Build module
45+
run: pnpm module build
46+
47+
- name: Lint module
48+
run: pnpm module lint
49+
50+
- name: Lint sample
51+
run: pnpm sample lint
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: React Native — Run Android Tests
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
env:
8+
JAVA_VERSION: '22'
9+
10+
jobs:
11+
test-android:
12+
name: Run Android Tests
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 20
15+
defaults:
16+
run:
17+
working-directory: platforms/react-native
18+
steps:
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
21+
- name: Setup Node.js and pnpm
22+
uses: shop/setup-javascript-action@main
23+
with:
24+
node-version-file: platforms/react-native/package.json
25+
cache-dependency-path: platforms/react-native/pnpm-lock.yaml
26+
27+
- name: Install JDK
28+
id: setup-java
29+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
30+
with:
31+
distribution: zulu
32+
java-version: ${{ env.JAVA_VERSION }}
33+
34+
- name: Cache turbo build setup
35+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
36+
with:
37+
path: platforms/react-native/.turbo
38+
key: ${{ runner.os }}-turbo-${{ github.sha }}
39+
restore-keys: |
40+
${{ runner.os }}-turbo-
41+
42+
- name: Install dependencies
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Run Android tests
46+
timeout-minutes: 20
47+
env:
48+
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
49+
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
50+
run: |
51+
echo "JAVA_HOME: $JAVA_HOME"
52+
java -version
53+
javac -version
54+
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
55+
pnpm module build
56+
pnpm sample test:android --no-daemon

.github/workflows/rn-test-ios.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: React Native — Run iOS Tests
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
test-ios:
9+
name: Run iOS Tests
10+
runs-on: ${{ vars.MACOS_RUNNER }}
11+
timeout-minutes: 30
12+
defaults:
13+
run:
14+
working-directory: platforms/react-native
15+
steps:
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
18+
- name: Display Xcode info
19+
run: |
20+
echo "Xcode Path: $(xcode-select -p)"
21+
echo "Xcode Version: $(xcrun xcodebuild -version)"
22+
23+
- name: Setup iOS Simulator
24+
run: |
25+
xcrun simctl list runtimes
26+
xcrun simctl list devicetypes | grep iPhone
27+
xcrun simctl delete all
28+
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro")
29+
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> "$GITHUB_ENV"
30+
31+
- name: Setup Node.js and pnpm
32+
uses: shop/setup-javascript-action@main
33+
with:
34+
node-version-file: platforms/react-native/package.json
35+
cache-dependency-path: platforms/react-native/pnpm-lock.yaml
36+
37+
- name: Cache turbo build setup
38+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
39+
with:
40+
path: platforms/react-native/.turbo
41+
key: ${{ runner.os }}-turbo-${{ github.sha }}
42+
restore-keys: |
43+
${{ runner.os }}-turbo-
44+
45+
- name: Install dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- name: Setup Ruby
49+
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
50+
with:
51+
ruby-version: 3.3.6
52+
bundler-cache: true
53+
working-directory: platforms/react-native/sample
54+
55+
- name: Cache cocoapods
56+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
57+
with:
58+
path: platforms/react-native/sample/ios/Pods
59+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json', 'platforms/react-native/pnpm-lock.yaml') }}
60+
61+
- name: Install cocoapods
62+
working-directory: platforms/react-native/sample
63+
run: |
64+
set -euo pipefail
65+
bundle install
66+
cd ios
67+
bundle exec pod install --deployment --repo-update
68+
69+
- name: Build module
70+
run: pnpm module build
71+
72+
- name: Run iOS tests
73+
run: pnpm sample test:ios

0 commit comments

Comments
 (0)