Created
June 19, 2019 18:20
-
-
Save transitive-bullshit/b7b000de5eaca24f56a0b91548d1c958 to your computer and use it in GitHub Desktop.
GitLab CI Detox React Native Example
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
stages: | |
- E2E | |
.ios_base: | |
tags: | |
- macOS | |
- swiftlint | |
cache: | |
paths: | |
- node_modules | |
- ios/vendor | |
before_script: | |
- npm i | |
- cd ios | |
- bundle install --without=documentation --deployment | |
Detox: | |
extends: .ios_base | |
stage: Detox | |
variables: | |
E2E: "true" | |
tags: | |
- macOS | |
- simulator | |
only: | |
- merge_requests | |
before_script: | |
- xcodebuild -version | |
- node --version | |
- brew tap wix/brew > /dev/null 2>&1 | |
- brew install applesimutils > /dev/null 2>&1 | |
- npm i -g npx > /dev/null 2>&1 | |
- rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/haste-* | |
- rm -rf ios/build | |
- killall node || echo | |
- xcrun simctl shutdown all | |
script: | |
- E2E=true npm start -- --port 8081 & | |
- npx detox build > /dev/null 2>&1 | |
- npx detox test --cleanup --loglevel info | |
- kill -9 $(lsof -n -i4TCP:8081) | |
after_script: | |
- xcrun simctl shutdown all | |
- (if [ "$(lsof -n -i4TCP:8081)" != "" ]; then kill -9 $(lsof -n -i4TCP:8081); else echo "Cleaned"; exit 33; fi); |
pls provide the repo for this file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some extra useful bits for anyone working on this: