feat: android strong box 📦 #68
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer | |
CP_HOME_DIR: ${{ github.workspace }}/.cocoapods | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'main' }} | |
jobs: | |
npm_install: | |
name: Install NPM packages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
expo_lint: | |
name: ESLint check | |
runs-on: ubuntu-latest | |
needs: [npm_install] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- run: npm run lint | |
expo_build: | |
name: Build Expo module | |
runs-on: ubuntu-latest | |
needs: [npm_install] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- run: npm run build | |
expo_fingerprint: | |
name: Calculate fingerprint | |
runs-on: ubuntu-latest | |
needs: [npm_install] | |
outputs: | |
fingerprint: ${{ steps.expo-fingerprint.outputs.fingerprint }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- uses: ./.github/actions/expo-fingerprint | |
id: expo-fingerprint | |
prebuild_android: | |
name: Expo prebuild Android | |
runs-on: ubuntu-latest | |
needs: [expo_fingerprint] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- uses: ./.github/actions/expo-prebuild | |
with: | |
cache-key: prebuild-android-${{ needs.expo_fingerprint.outputs.fingerprint }} | |
platform: android | |
prebuild_ios: | |
name: Expo prebuild iOS | |
runs-on: ubuntu-latest | |
needs: [expo_fingerprint] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- uses: ./.github/actions/expo-prebuild | |
with: | |
cache-key: prebuild-ios-${{ needs.expo_fingerprint.outputs.fingerprint }} | |
platform: ios | |
test_android: | |
name: Test Android | |
# Can't run on macos-latest: https://github.com/ReactiveCircus/android-emulator-runner/issues/392 | |
runs-on: macos-13 | |
needs: [expo_fingerprint, prebuild_android] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- uses: actions/cache/restore@v4 | |
with: | |
path: ./example/android | |
key: prebuild-android-${{ needs.expo_fingerprint.outputs.fingerprint }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Test Android Module | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 34 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
target: google_apis | |
arch: x86_64 | |
working-directory: ./example/android | |
script: ./gradlew expo-signature:connectedAndroidTest | |
disable-animations: true | |
test_ios: | |
name: Test iOS | |
runs-on: macos-latest | |
needs: [expo_fingerprint, prebuild_ios] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/npm-install | |
- name: Cache CocoaPods | |
id: cocoapods-cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CP_HOME_DIR }} | |
key: ${{ runner.os }}-pods | |
- uses: actions/cache/restore@v4 | |
with: | |
path: ./example/ios | |
key: prebuild-ios-${{ needs.expo_fingerprint.outputs.fingerprint }} | |
- uses: irgaly/xcode-cache@v1 | |
with: | |
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} | |
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}- | |
- uses: ./.github/actions/npm-install | |
- name: Pod install | |
working-directory: ./example/ios | |
run: pod install | |
- name: Test iOS Module | |
working-directory: ./example | |
run: | | |
xcodebuild test \ | |
-workspace ios/exposignatureexample.xcworkspace \ | |
-scheme SignatureModule-Unit-Tests \ | |
-destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=latest' |