Skip to content

Instantly share code, notes, and snippets.

@mrkpatchaa
Forked from PillowUnicorn/detox-bitrise.yml
Created November 10, 2017 08:55
Show Gist options
  • Save mrkpatchaa/c82d851f54701109d624ceffc1879842 to your computer and use it in GitHub Desktop.
Save mrkpatchaa/c82d851f54701109d624ceffc1879842 to your computer and use it in GitHub Desktop.

Revisions

  1. @PillowUnicorn PillowUnicorn revised this gist Sep 7, 2017. 1 changed file with 32 additions and 34 deletions.
    66 changes: 32 additions & 34 deletions detox-bitrise.yml
    Original file line number Diff line number Diff line change
    @@ -1,36 +1,40 @@
    ---
    format_version: 1.1.0
    default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
    trigger_map:
    - push_branch: "*"
    workflow: tests
    workflows:
    _unit_tests:
    steps:
    - script:
    title: Run Unit Tests
    inputs:
    - content: |-
    #!/bin/bash
    npm run test
    is_always_run: true
    before_run:
    after_run:
    _tests_setup:
    steps:
    - activate-ssh-key: {}
    - git-clone:
    inputs:
    - clone_depth: ''
    - [email protected]:
    title: Git Clone Repo
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    npm cache verify
    npm install
    title: Install Packages
    before_run:
    after_run:
    title: Install NPM Packages
    before_run:
    after_run:
    _unit_tests:
    steps:
    - script:
    title: Run Unit Tests
    inputs:
    - content: |-
    #!/bin/bash
    npm run test
    is_always_run: true
    before_run:
    after_run:
    _detox_tests:
    before_run: []
    after_run: []
    @@ -39,7 +43,7 @@ workflows:
    inputs:
    - command: install -g detox-cli
    title: Install Detox CLI
    - npm@0.9.0:
    - npm:
    inputs:
    - command: install -g react-native-cli
    title: Install React Native CLI
    @@ -55,48 +59,42 @@ workflows:
    brew tap wix/brew
    brew install applesimutils --HEAD
    title: Install Detox Utils
    - [email protected]:
    title: Start Packager in Background
    inputs:
    - content: |-
    #!/bin/bash
    npm run start &
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    detox build --configuration ios.sim.release
    title: Build Detox app
    title: Detox - Build Release App
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    detox test --configuration ios.sim.release
    - is_debug: 'yes'
    title: Run Detox Integration Tests
    detox test --configuration ios.sim.release --cleanup
    title: Detox - Run E2E Tests
    tests:
    before_run:
    - _tests_setup
    - _unit_tests
    - _detox_tests
    after_run:
    - _tests_slack_message
    _tests_slack_message:
    before_run: []
    steps:
    - slack@2.6.2:
    - slack:
    inputs:
    - webhook_url: https://hooks.slack.com/services/xxxx
    - webhook_url: #SLACK_WEBHOOK_URL#
    - channel: "#builds"
    - from_username_on_error: Bitrise CI - Tests Shall Not Pass!!
    - from_username: Bitrise CI - Integration & Unit Tests Passing
    - from_username: Bitrise CI - Unit & E2E Tests Passed
    - message: |-
    *Build succeeded*: $BITRISE_GIT_MESSAGE
    *Branch*: $BITRISE_GIT_BRANCH
    Fuck it! Ship it!
    - message_on_error: |-
    *Build failed*: $BITRISE_GIT_MESSAGE
    *Branch*: $BITRISE_GIT_BRANCH
    _I believe in you!! Please try again._
    - emoji: ":shipit:"
    - emoji_on_error: ":bug:"
    title: Slack - Send Build Status
  2. @PillowUnicorn PillowUnicorn created this gist Sep 6, 2017.
    102 changes: 102 additions & 0 deletions detox-bitrise.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,102 @@
    ---
    format_version: 1.1.0
    default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
    workflows:
    _unit_tests:
    steps:
    - script:
    title: Run Unit Tests
    inputs:
    - content: |-
    #!/bin/bash
    npm run test
    is_always_run: true
    before_run:
    after_run:
    _tests_setup:
    steps:
    - activate-ssh-key: {}
    - git-clone:
    inputs:
    - clone_depth: ''
    - [email protected]:
    inputs:
    - content: |-
    #!/bin/bash
    npm cache verify
    npm install
    title: Install Packages
    before_run:
    after_run:
    _detox_tests:
    before_run: []
    after_run: []
    steps:
    - npm:
    inputs:
    - command: install -g detox-cli
    title: Install Detox CLI
    - [email protected]:
    inputs:
    - command: install -g react-native-cli
    title: Install React Native CLI
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    brew tap facebook/fb
    export CODE_SIGNING_REQUIRED=NO
    brew install fbsimctl
    brew tap wix/brew
    brew install applesimutils --HEAD
    title: Install Detox Utils
    - [email protected]:
    title: Start Packager in Background
    inputs:
    - content: |-
    #!/bin/bash
    npm run start &
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    detox build --configuration ios.sim.release
    title: Build Detox app
    - script:
    inputs:
    - content: |-
    #!/bin/bash
    detox test --configuration ios.sim.release
    - is_debug: 'yes'
    title: Run Detox Integration Tests
    tests:
    before_run:
    - _tests_setup
    - _unit_tests
    - _detox_tests
    steps:
    - [email protected]:
    inputs:
    - webhook_url: https://hooks.slack.com/services/xxxx
    - channel: "#builds"
    - from_username_on_error: Bitrise CI - Tests Shall Not Pass!!
    - from_username: Bitrise CI - Integration & Unit Tests Passing
    - message: |-
    *Build succeeded*: $BITRISE_GIT_MESSAGE
    *Branch*: $BITRISE_GIT_BRANCH
    Fuck it! Ship it!
    - message_on_error: |-
    *Build failed*: $BITRISE_GIT_MESSAGE
    *Branch*: $BITRISE_GIT_BRANCH
    _I believe in you!! Please try again._
    - emoji: ":shipit:"
    - emoji_on_error: ":bug:"