Skip to content

Commit

Permalink
Merge pull request #5 from iynere/master
Browse files Browse the repository at this point in the history
polish up react native demo
  • Loading branch information
iynere authored Mar 29, 2018
2 parents c6b255a + 95a32dc commit 5f887a2
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 52 deletions.
147 changes: 118 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,157 @@
version: 2
jobs:
build:
working_directory: ~/project
node:
working_directory: ~/demo-react-native
docker:
- image: circleci/node:8
steps:
- checkout
- run: yarn
- run: yarn run test

- restore_cache:
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}

- restore_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}

- run: yarn install

- save_cache:
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
paths:
- ~/.cache/yarn

- save_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
paths:
- node_modules

- run:
name: jest tests
command: |
mkdir -p test-results/jest
yarn run test
environment:
JEST_JUNIT_OUTPUT: test-results/jest/junit.xml

- persist_to_workspace:
root: ~/project
root: ~/demo-react-native
paths:
- node_modules

- store_test_results:
path: ~/project/junit.xml
path: test-results

- store_artifacts:
path: test-results

android:
working_directory: ~/project/android
working_directory: ~/demo-react-native/android
docker:
- image: circleci/android:api-27-node8-alpha
steps:
- checkout:
path: ~/project
path: ~/demo-react-native

- attach_workspace:
at: ~/project
at: ~/demo-react-native

- restore_cache:
key: bundle-v1-{{ checksum "Gemfile.lock" }}-{{ arch }}

- run: bundle install
- run: bundle exec fastlane test

- save_cache:
key: bundle-v1-{{ checksum "Gemfile.lock" }}-{{ arch }}
paths:
- vendor/bundle

- run:
name: fastlane tests
command: |
mkdir -p test-results/fastlane
bundle exec fastlane test
mv fastlane/report.xml test-results/fastlane
- store_test_results:
path: ~/project/android/reports
path: test-results

- store_artifacts:
path: test-results

ios:
macos:
xcode: "9.0"
working_directory: /Users/distiller/project/ios
environment:
FL_OUTPUT_DIR: /Users/distiller/project/output
working_directory: ~/demo-react-native

# use a --login shell so our "set Ruby version" command gets picked up for later steps
shell: /bin/bash --login -o pipefail

steps:
- checkout:
path: /Users/distiller/project
- checkout

- run:
name: Set Ruby Version
name: set Ruby version
command: echo "ruby-2.4" > ~/.ruby-version
# Not using a workspace here as Node and Yarn versions
# differ between the macOS image and the Docker containers above.
- run: yarn
- run: bundle install
- run: bundle exec fastlane test

- restore_cache:
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}

- restore_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}

# not using a workspace here as Node and Yarn versions
# differ between our macOS executor image and the Docker containers above
- run: yarn install

- save_cache:
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
paths:
- ~/.cache/yarn

- save_cache:
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
paths:
- node_modules

- restore_cache:
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}

- run:
command: bundle install
working_directory: ios

- save_cache:
key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}
paths:
- vendor/bundle

- run:
command: cp $FL_OUTPUT_DIR/scan/report.junit $FL_OUTPUT_DIR/scan/results.xml
command: bundle exec fastlane test
working_directory: ios

- run:
name: set up test results
working_directory: ios
when: always
- store_artifacts:
path: /Users/distiller/project/output
command: |
mkdir -p test-results/fastlane test-results/xcode
mv fastlane/report.xml test-results/fastlane
mv fastlane/test_output/report.junit test-results/xcode/junit.xml
- store_test_results:
path: /Users/distiller/project/output/scan
path: ios/test-results

- store_artifacts:
path: ios/test-results

workflows:
version: 2
node-android-ios:
jobs:
- build
- node
- android:
requires:
- build
- node
- ios:
requires:
- build
- node
23 changes: 0 additions & 23 deletions android/fastlane/report.xml

This file was deleted.

0 comments on commit 5f887a2

Please sign in to comment.