feat: e2e tests #29
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: 🛠 iOS e2e tests | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/ios-e2e-test.yml' | |
- 'react-native-keyboard-controller.podspec' | |
- 'package.json' | |
- 'ios/**' | |
- 'example/**' | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: ⚙️ Automated test cases | |
runs-on: macos-12 | |
timeout-minutes: 60 | |
env: | |
WORKING_DIRECTORY: example | |
concurrency: | |
group: ios-e2e-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: 'yarn' | |
- name: Get Xcode version | |
run: xcodebuild -version | |
- name: Install AppleSimulatorUtils | |
run: brew tap wix/brew && brew install applesimutils | |
- name: Install root dependencies | |
run: yarn install | |
- name: Install example project dependencies | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
run: yarn | |
- name: Install detox dependencies | |
run: yarn install --cwd detox | |
- name: Restore buildcache | |
uses: mikehardy/buildcache-action@v2 | |
continue-on-error: true | |
with: | |
cache_key: react-native-keyboard-controller-detox | |
- name: Restore Pods cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
example/ios/Pods | |
~/Library/Caches/CocoaPods | |
~/.cocoapods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Install pods | |
working-directory: ${{ env.WORKING_DIRECTORY }}/ios | |
run: pod install | |
- name: Build app | |
working-directory: detox | |
run: yarn build-example:ios | |
- name: Use software keyboard | |
run: defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool NO | |
- name: Test app | |
working-directory: detox | |
run: yarn test-example:ios | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ios-fail-screen-shoots | |
path: detox/artifacts |