Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,54 @@ updates:
apollo:
patterns:
- "com.apollographql.apollo*"

# React Native — root pnpm workspace
- package-ecosystem: npm
directory: "/platforms/react-native"
schedule:
interval: daily
cooldown:
default-days: 7
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"

# React Native — Checkout Sheet Kit module
- package-ecosystem: npm
directory: "/platforms/react-native/modules/@shopify/checkout-sheet-kit"
schedule:
interval: daily
cooldown:
default-days: 7
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"

# React Native — sample app
- package-ecosystem: npm
directory: "/platforms/react-native/sample"
schedule:
interval: daily
cooldown:
default-days: 7
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"

# React Native — sample iOS CocoaPods (via Bundler/Gemfile)
- package-ecosystem: bundler
directory: "/platforms/react-native/sample"
schedule:
interval: daily
cooldown:
default-days: 7
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
- '.github/workflows/ci.yml'
reactNative:
- 'platforms/react-native/**'
- '.github/workflows/rn-test.yml'
- '.github/workflows/rn-test-android.yml'
- '.github/workflows/rn-test-ios.yml'
- '.github/workflows/rn-license-headers.yml'
- '.github/workflows/rn-check-packed-files.yml'
- '.github/workflows/rn-lint.yml'
- '.github/workflows/ci.yml'

android-test:
Expand Down Expand Up @@ -82,6 +88,45 @@ jobs:
if: needs.changes.outputs.swift == 'true'
uses: ./.github/workflows/swift-lint.yml

rn-test:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
permissions:
contents: read
pull-requests: write
uses: ./.github/workflows/rn-test.yml

rn-test-android:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
uses: ./.github/workflows/rn-test-android.yml

rn-test-ios:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
uses: ./.github/workflows/rn-test-ios.yml

rn-license-headers:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
uses: ./.github/workflows/rn-license-headers.yml

rn-check-packed-files:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
uses: ./.github/workflows/rn-check-packed-files.yml

rn-lint:
name: React Native
needs: changes
if: needs.changes.outputs.reactNative == 'true'
uses: ./.github/workflows/rn-lint.yml

# Single required status check for branch protection.
# Passes when every relevant platform job either succeeded or was skipped
# because no files in that platform's tree changed.
Expand All @@ -95,6 +140,12 @@ jobs:
- swift-test-package
- swift-build-samples
- swift-lint
- rn-test
- rn-test-android
- rn-test-ios
- rn-license-headers
- rn-check-packed-files
- rn-lint
runs-on: ubuntu-latest
steps:
- name: Verify all upstream jobs succeeded or were skipped
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/rn-check-packed-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: React Native — Check Packed Files

on:
workflow_call:
workflow_dispatch:

jobs:
check-packed-files:
name: Check package files
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TERM: xterm
defaults:
run:
working-directory: platforms/react-native
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js and pnpm
uses: shop/setup-javascript-action@main
with:
node-version-file: platforms/react-native/package.json
cache-dependency-path: platforms/react-native/pnpm-lock.yaml

- name: Cache turbo build setup
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build module and compare snapshot
run: |
pnpm module clean
pnpm module build
pnpm compare-snapshot
19 changes: 19 additions & 0 deletions .github/workflows/rn-license-headers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: React Native — Check License Headers

on:
workflow_call:
workflow_dispatch:

jobs:
license:
name: Verify license headers
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: platforms/react-native
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check license headers
run: ./scripts/copy_license --check
51 changes: 51 additions & 0 deletions .github/workflows/rn-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: React Native — Lint

on:
workflow_call:
workflow_dispatch:

jobs:
swiftlint:
name: SwiftLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
with:
args: --strict

lint:
name: Lint module + sample
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: platforms/react-native
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js and pnpm
uses: shop/setup-javascript-action@main
with:
node-version-file: platforms/react-native/package.json
cache-dependency-path: platforms/react-native/pnpm-lock.yaml

- name: Cache turbo build setup
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build module
run: pnpm module build

- name: Lint module
run: pnpm module lint

- name: Lint sample
run: pnpm sample lint
56 changes: 56 additions & 0 deletions .github/workflows/rn-test-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: React Native — Run Android Tests

on:
workflow_call:
workflow_dispatch:

env:
JAVA_VERSION: '22'

jobs:
test-android:
name: Run Android Tests
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: platforms/react-native
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js and pnpm
uses: shop/setup-javascript-action@main
with:
node-version-file: platforms/react-native/package.json
cache-dependency-path: platforms/react-native/pnpm-lock.yaml

- name: Install JDK
id: setup-java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: zulu
java-version: ${{ env.JAVA_VERSION }}

- name: Cache turbo build setup
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Android tests
timeout-minutes: 20
env:
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
run: |
echo "JAVA_HOME: $JAVA_HOME"
java -version
javac -version
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
pnpm module build
pnpm sample test:android --no-daemon
73 changes: 73 additions & 0 deletions .github/workflows/rn-test-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: React Native — Run iOS Tests

on:
workflow_call:
workflow_dispatch:

jobs:
test-ios:
name: Run iOS Tests
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 30
defaults:
run:
working-directory: platforms/react-native
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Display Xcode info
run: |
echo "Xcode Path: $(xcode-select -p)"
echo "Xcode Version: $(xcrun xcodebuild -version)"

- name: Setup iOS Simulator
run: |
xcrun simctl list runtimes
xcrun simctl list devicetypes | grep iPhone
xcrun simctl delete all
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro")
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> "$GITHUB_ENV"

- name: Setup Node.js and pnpm
uses: shop/setup-javascript-action@main
with:
node-version-file: platforms/react-native/package.json
cache-dependency-path: platforms/react-native/pnpm-lock.yaml

- name: Cache turbo build setup
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup Ruby
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
ruby-version: 3.3.6
bundler-cache: true
working-directory: platforms/react-native/sample

- name: Cache cocoapods
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/sample/ios/Pods
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') }}

- name: Install cocoapods
working-directory: platforms/react-native/sample
run: |
set -euo pipefail
bundle install
cd ios
bundle exec pod install --deployment --repo-update

- name: Build module
run: pnpm module build

- name: Run iOS tests
run: pnpm sample test:ios
Loading