Skip to content

Instantly share code, notes, and snippets.

@edvinasbartkus
Created November 16, 2019 10:06
Show Gist options
  • Save edvinasbartkus/1e3118dd13c44f43988fcd40e8308db3 to your computer and use it in GitHub Desktop.
Save edvinasbartkus/1e3118dd13c44f43988fcd40e8308db3 to your computer and use it in GitHub Desktop.

Revisions

  1. edvinasbartkus created this gist Nov 16, 2019.
    46 changes: 46 additions & 0 deletions .github-workflows-main.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    name: Detox

    on: [push]

    jobs:
    build:
    runs-on: macOS-latest
    timeout-minutes: 15

    env:
    DEVELOPER_DIR: /Applications/Xcode_11.2.app
    steps:
    - uses: actions/checkout@master
    - uses: actions/setup-node@master

    - name: Cache node modules
    uses: actions/cache@v1
    id: cache
    with:
    path: node_modules
    key: node-modules-${{ hashFiles('**/yarn.lock') }}

    - name: Rebuild detox
    if: steps.cache.outputs.cache-hit == 'true'
    run: yarn detox-setup

    - name: Install Dependencies
    if: steps.cache.outputs.cache-hit != 'true'
    run: yarn install

    - name: Cache Pods
    uses: actions/cache@v1
    id: podcache
    with:
    path: ios/Pods
    key: pods-${{ hashFiles('**/Podfile.lock') }}

    - name: Update Pods
    run: |
    gem update cocoapods xcodeproj
    cd ios && pod install && cd ..
    - run: brew tap wix/brew
    - run: brew install applesimutils
    - run: yarn detox build e2e --configuration ios.sim.release
    - run: yarn detox test e2e --configuration ios.sim.release --cleanup --debug-synchronization 200
    23 changes: 23 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    {
    "scripts": {
    "detox-setup": "detox clean-framework-cache && detox build-framework-cache"
    },
    "detox": {
    "configurations": {
    "ios.sim.debug": {
    "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/App.app",
    "build": "xcodebuild -workspace ios/app.xcworkspace -scheme app -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
    "type": "ios.simulator",
    "name": "iPhone 8"
    },
    "ios.sim.release": {
    "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/App.app",
    "build": "xcodebuild -workspace ios/app.xcworkspace -scheme app -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
    "type": "ios.simulator",
    "name": "iPhone 8"
    }
    },
    "test-runner": "jest",
    "specs": "e2e"
    }
    }