Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dbe325d
chore: (Android) Config - add option to specify buildType
manosim Oct 18, 2021
220934a
Setup android job
manosim Oct 18, 2021
66e6d90
Remove missed iOS step
manosim Oct 18, 2021
be9cbbe
Add tmate step
manosim Oct 18, 2021
0e10dda
Nicer output from gradlew command
manosim Oct 18, 2021
7317cea
Attempt to install the sdks, create & boot the emulator
manosim Oct 18, 2021
81b9775
Switch to ubuntu-18.04
manosim Oct 18, 2021
0706de9
Valid workflow
manosim Oct 18, 2021
1d2b6ad
Correct simulator name
manosim Oct 18, 2021
775b9d8
Retry
manosim Oct 18, 2021
25d3bbf
Run on macos because of HAXM
manosim Oct 18, 2021
91e8b71
Retry
manosim Oct 18, 2021
3b8176a
Add step to become root in adb (required to set time in emulator)
manosim Oct 18, 2021
c10b032
Reorder so that emulator has time to boot
manosim Oct 18, 2021
accf8f6
Merge branch 'main' into chore/ci-demo-android
manosim Nov 2, 2021
e7fae09
Merge branch 'main' into chore/ci-demo-android
manosim May 20, 2022
14a85e3
chore: Remove adb root
manosim May 20, 2022
972550d
chore: Fix tests
manosim May 20, 2022
8d23ac0
chore: Debug devices
manosim May 20, 2022
157ce31
chore: Set emulator's disk size
manosim May 20, 2022
6b3e056
chore: Adb wait for device
manosim May 20, 2022
23c1899
chore: Timeout with bash
manosim May 22, 2022
538bfc8
chore: Use timeout_minutes
manosim May 22, 2022
7b0df6d
chore: clean up
manosim May 22, 2022
6591b73
Update demo-app.yml
manosim May 23, 2022
affde7d
chore: Specify Pixel 2 for the emulator
manosim May 23, 2022
c408edf
chore: Revert command arg
manosim May 23, 2022
39c7794
chore: Use "Nexus 5X" to match "Pixel 2"'s config
manosim May 23, 2022
91bce4f
chore: Clean Up
manosim May 23, 2022
4f1edb3
chore: Use existing github action to handle emulator launch
manosim May 23, 2022
ca88163
chore: Fix systax
manosim May 23, 2022
bd5e336
chore: Add architecture
manosim May 23, 2022
3f66585
chore: Store screenshots if tests fail
manosim May 23, 2022
b9eb17d
chore: Back to custom config
manosim May 23, 2022
c8d3143
chore: Attempt to give more RAM for the emulator
manosim May 23, 2022
d896931
chore: Move memory arg
manosim May 23, 2022
7d4ba85
Update demo-app.yml
manosim May 25, 2022
e380a49
chore: Attempt to use google imag
manosim May 30, 2022
d8a886f
chore: More memory
manosim May 30, 2022
efecccf
chore: More storage
manosim May 30, 2022
4a0b3ee
chore: Rollback changes
manosim May 30, 2022
e79009e
Merge branch 'main' into chore/ci-demo-android
manosim May 30, 2022
f4a7cda
chore: Wipe data
manosim May 30, 2022
43a6463
Merge branch 'main' into chore/ci-demo-android
manosim Jun 1, 2022
83222b1
chore: Add example workflow to docs
manosim Jun 1, 2022
b917fd2
chore: Update copy in the docs
manosim Jun 1, 2022
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
75 changes: 73 additions & 2 deletions .github/workflows/demo-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: yarn install --frozen-lockfile
working-directory: ./example

- name: Install CocoaPods
- name: Install CocoaPods Gem
run: gem install cocoapods -v 1.11.0

- uses: actions/cache@v2
Expand All @@ -46,7 +46,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-

- name: Install CocoaPods
- name: Install Pods
run: pod install
working-directory: ./example/ios

Expand All @@ -69,3 +69,74 @@ jobs:
with:
name: owl-results
path: example/.owl

run-visual-regression-android:
runs-on: macos-11
if: ${{ false }}

steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
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@v2
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/tools/bin/sdkmanager "system-images;android-30;default;x86_64"

- name: SDKs - accept licenses
run: y | $ANDROID_HOME/tools/bin/sdkmanager --licenses

- name: Emulator - Create
run: $ANDROID_HOME/tools/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: Store screenshots as artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: owl-screenshots
path: example/.owl
4 changes: 0 additions & 4 deletions docs/advanced/_category_.json

This file was deleted.

85 changes: 0 additions & 85 deletions docs/advanced/running-ci.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/ci/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Running on CI",
"position": 4
}
146 changes: 146 additions & 0 deletions docs/ci/github-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
sidebar_position: 1
---

# GitHub Actions

:::info

With visual regression testing, it is all about **consistency**. Please make sure that you use the same simulator across environments. Use the same emulator configuration to generate the baseline images and for running the test suite on CI so that the library can compare the screenshots. The library will not be able to compare different sizes and resolutions of screenshots.

:::

### iOS

To run the tests on an iOS simulator, you will need to use a [macOS based runner](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources).

```yaml title=".github/workflows/visual-regression-ios.yml"
name: Visual Regression - iOS

on: [pull_request]

jobs:
run-visual-regression-ios:
runs-on: macos-11

steps:
- uses: actions/checkout@v2

- name: Get Runner Information
run: /usr/bin/xcodebuild -version

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
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
run: yarn install --frozen-lockfile

- name: Install CocoaPods
run: gem install cocoapods -v 1.11.0

- uses: actions/cache@v2
with:
path: ./ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Install CocoaPods
run: pod install
working-directory: ./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

- name: Run Owl Test
run: yarn owl:test:ios

- name: Store screenshots and report as artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: owl-results
path: ./.owl
```

### Android

```yaml title=".github/workflows/visual-regression-android.yml"
name: Visual Regression - Android

on: [pull_request]

jobs:
run-visual-regression-android:
runs-on: macos-11

steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
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
run: yarn install --frozen-lockfile

- uses: actions/cache@v2
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/tools/bin/sdkmanager "system-images;android-30;default;x86_64"

- name: SDKs - accept licenses
run: y | $ANDROID_HOME/tools/bin/sdkmanager --licenses

- name: Emulator - Create
run: $ANDROID_HOME/tools/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

- name: Run Owl Test
run: yarn owl:test:android

- name: Store screenshots as artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: owl-screenshots
path: ./.owl
```