chore: Enable Android workflow for the demo app #401
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: Demo App | |
on: [pull_request] | |
jobs: | |
run-visual-regression-ios: | |
runs-on: macos-11 | |
if: ${{ false }} # FIXME: Remove before merging | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: actions/checkout@v3 | |
- name: Get Runner Information | |
run: /usr/bin/xcodebuild -version | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v3 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies (Library) | |
run: yarn install --frozen-lockfile | |
working-directory: ./ | |
- name: Compile the library | |
run: yarn build | |
working-directory: ./ | |
- name: Install Dependencies (Example App) | |
run: yarn install --frozen-lockfile | |
working-directory: ./example | |
- name: Install CocoaPods Gem | |
run: gem install cocoapods -v 1.11.0 | |
- uses: actions/cache@v2 | |
with: | |
path: ./example/ios/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Install Pods | |
run: pod install | |
working-directory: ./example/ios | |
- uses: futureware-tech/simulator-action@v1 | |
with: | |
model: 'iPhone 13 Pro' | |
os_version: '>=15.0' | |
- name: Run Owl Build | |
run: yarn owl:build:ios | |
working-directory: ./example | |
- name: Run Owl Test | |
run: yarn owl:test:ios | |
working-directory: ./example | |
- name: Store screenshots and report as artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: owl-results | |
path: example/.owl | |
run-visual-regression-android: | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v3 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies (Library) | |
run: yarn install --frozen-lockfile | |
working-directory: ./ | |
- name: Compile the library | |
run: yarn build | |
working-directory: ./ | |
- name: Install Dependencies (Example App) | |
run: yarn install --frozen-lockfile | |
working-directory: ./example | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: SKDs - download required images | |
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;default;x86_64" | |
- name: SDKs - accept licenses | |
run: y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses | |
- name: Emulator - Create | |
run: $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_30 --device 'Nexus 5X' --package "system-images;android-30;default;x86_64" --sdcard 512M | |
- name: Emulator - Boot | |
run: $ANDROID_HOME/emulator/emulator -memory 4096 -avd Pixel_API_30 -wipe-data -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim & | |
- name: ADB Wait For Device | |
run: adb wait-for-any-device | |
timeout-minutes: 3 | |
- name: Run Owl Build | |
run: yarn owl:build:android | |
working-directory: ./example | |
- name: Run Owl Test | |
run: yarn owl:test:android | |
working-directory: ./example | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Store screenshots as artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: owl-screenshots | |
path: example/.owl |