Skip to content

Commit

Permalink
ci: build Android/iOS/macOS test apps on CI (react-native-webview#2383)
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 authored Feb 18, 2022
1 parent 68242f4 commit b1c48ce
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Android
on:
push:
branches:
- master
pull_request:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2.5.1
with:
node-version: 16
- name: Set up JDK
uses: actions/setup-java@v2.5.0
with:
distribution: temurin
java-version: 11
- name: Cache /node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install npm dependencies
run: yarn --frozen-lockfile
shell: bash
- name: Build Android test app
uses: gradle/gradle-build-action@v2.1.3
with:
gradle-version: wrapper
arguments: --no-daemon clean build check test
build-root-directory: example/android
timeout-minutes: 60
35 changes: 35 additions & 0 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: iOS
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2.5.1
with:
node-version: 16
- name: Cache /node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install npm dependencies
run: yarn --frozen-lockfile
- name: Install Pods
run: pod install
working-directory: example/ios
- name: Build iOS test app
run: |
device_name='iPhone 13'
device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
re='\(([-0-9A-Fa-f]+)\)'
[[ $device =~ $re ]] || exit 1
xcodebuild -workspace WebviewExample.xcworkspace -scheme ReactTestApp -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
working-directory: example/ios
timeout-minutes: 60
31 changes: 31 additions & 0 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: macOS
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2.5.1
with:
node-version: 16
- name: Cache /node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install npm dependencies
run: yarn --frozen-lockfile
- name: Install Pods
run: pod install
working-directory: example/macos
- name: Build macOS test app
run: |
xcodebuild -workspace WebviewExample.xcworkspace -scheme ReactTestApp CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
working-directory: example/macos
timeout-minutes: 60

0 comments on commit b1c48ce

Please sign in to comment.