diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 500c345c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,419 +0,0 @@ -version: 2.1 - -orbs: - android: circleci/android@2.0.0 - heroku: circleci/heroku@1.2.6 - macos: circleci/macos@2.1.0 - ruby: circleci/ruby@1.4.0 - -executors: - linux_js: - docker: - - image: cimg/node:16.15.0 - resource_class: medium+ - environment: - PATH: '/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' - - macos_custom: - parameters: - xcode_version: - type: string - default: '13.3.0' - macos: - xcode: <> - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - -commands: - attach_project: - steps: - - attach_workspace: - at: ~/project - - pod_install: - parameters: - pod_install_directory: - type: string - default: 'dev-app/ios' - - steps: - - restore_cache: - keys: - - cache-pods-{{ checksum "<>/Podfile.lock" }}-v1 - - cache-pods- - - run: - name: Install CocoaPods - command: | - cd <> && pod install && cd - - echo "Checking for diffs in pod lockfile, if this fails please ensure all dependencies are up to date" - git diff --exit-code - - save_cache: - paths: - - <>/Pods - key: cache-pods-{{ checksum "<>/Podfile.lock" }}-v1 - - pod_install_example: - parameters: - pod_install_directory: - type: string - default: 'example-app/ios' - - steps: - - restore_cache: - keys: - - cache-pods-example-{{ checksum "<>/Podfile.lock" }}-v1 - - cache-pods-example- - - run: - name: Install CocoaPods - command: | - cd <> && pod install && cd - - echo "Checking for diffs in pod lockfile, if this fails please ensure all dependencies are up to date" - git diff --exit-code - - save_cache: - paths: - - <>/Pods - key: cache-pods--example-{{ checksum "<>/Podfile.lock" }}-v1 - - install_node: - parameters: - node_version: - type: string - default: '14.15.0' - steps: - - run: - name: Install node@<> - command: | - set +e - command -v nvm - nvm install <> - nvm alias default <> - nvm use default - node -v - - install_yarn: - steps: - - run: - name: Install yarn - command: | - set +e - npm install --global yarn - npm install --global expo-cli - source ~/.bashrc - yarn -v - - setup_macos_executor: - steps: - - attach_workspace: - at: . - - run: - name: Configure Environment Variables - command: | - echo 'export PATH="$PATH:~/project/node_modules/.bin:~/project/dev-app/node_modules/.bin"' >> $BASH_ENV - source $BASH_ENV - - install_node - - install_yarn - - restore_cache: - key: | - brew-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - restore_cache: - key: | - brew-taps-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - restore_cache: - key: | - brew-vendor-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - run: - name: Configure Detox Environment - command: | - brew update >/dev/null - brew bundle install >/dev/null - touch .watchmanconfig - - save_cache: - paths: - - ~/Library/Caches/Homebrew - key: | - brew-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - save_cache: - paths: - - /usr/local/Homebrew/Library/Taps - key: | - brew-taps-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - save_cache: - paths: - - /usr/local/Homebrew/Library/Homebrew/vendor/ - key: | - brew-vendor-cache-{{ arch }}-{{checksum "Brewfile"}}-v2 - - setup_android_executor: - steps: - - attach_workspace: - at: . - - run: - name: Configure Environment Variables - command: | - echo 'export PATH="$PATH:~/project/node_modules/.bin:~/project/dev-app/node_modules/.bin"' >> $BASH_ENV - source $BASH_ENV - - install_node - - install_yarn - - run: - name: Configure Detox Environment - command: | - touch .watchmanconfig - - android_emulator_start: - parameters: - device_name: - type: string - default: 'TestingAVD' - platform_version: - type: string - default: 'android-30' - logcat_grep: - type: string - default: 'com.dev.app.stripeterminalreactnative' - steps: - - android/create-avd: - avd-name: <> - install: true - system-image: system-images;<>;default;x86_64 - - android/start-emulator: - avd-name: <> - no-window: true - restore-gradle-cache-prefix: v1a - memory: 2048 - gpu: auto - run-logcat: true - post-emulator-launch-assemble-command: '' - -jobs: - install-dependencies: - executor: linux_js - steps: - - checkout - - attach_project - - restore_cache: - keys: - - dependencies-{{ checksum "package.json" }} - - dependencies- - - restore_cache: - keys: - - dependencies-dev-app-{{ checksum "dev-app/package.json" }} - - dependencies-dev-app- - - restore_cache: - keys: - - dependencies-example-app-{{ checksum "example-app/package.json" }} - - dependencies-example-app- - - run: - name: Install dependencies - command: | - set -e - yarn install --cwd example-app - yarn install --cwd dev-app - yarn install - echo "Checking for diffs in yarn lockfile, if this fails please ensure all dependencies are up to date" - git diff --exit-code - - save_cache: - key: dependencies-{{ checksum "package.json" }} - paths: [node_modules] - - save_cache: - key: dependencies-dev-app-{{ checksum "dev-app/package.json" }} - paths: [dev-app/node_modules] - - save_cache: - key: dependencies-example-app-{{ checksum "example-app/package.json" }} - paths: [example-app/node_modules] - - persist_to_workspace: - root: . - paths: [.] - - lint: - executor: linux_js - steps: - - attach_project - - run: - name: Lint files - command: | - yarn lint - typescript: - executor: linux_js - steps: - - attach_project - - run: - name: Typecheck files - command: | - yarn typescript - yarn --cwd example-app typescript - unit-js: - executor: linux_js - steps: - - attach_project - - run: - name: Jest - command: | - yarn unit-test:js --coverage - - store_test_results: - path: junit.xml - - store_artifacts: - path: coverage - unit-android: - executor: - name: android/android-machine - tag: 2021.10.1 - steps: - - setup_android_executor - - run: - command: yarn unit-test:android - name: unit tests - - store_test_results: - path: android/build/test-results/testDebugUnitTest - example-build-android: - executor: - name: android/android-machine - tag: 2021.10.1 - steps: - - setup_android_executor - - android_emulator_start - - run: - name: Build Example App - command: | - yarn --cwd example-app build:android:ci - example-build-ios: - executor: macos_custom - steps: - - setup_macos_executor - - pod_install_example - - run: - # we go a different route here and just build using xcode over expo - # as expo cannot find a booted simulator and _only_ buiding requires - # setting up an entire pipelinie to expo's cloud services - name: Build iOS Example App - command: | - yarn e2e:build:example:ios - test: - executor: linux_js - steps: - - attach_project - - run: - name: Integration tests - command: | - yarn test - - e2e-ios: - executor: macos_custom - steps: - - macos/preboot-simulator: - version: "15.4" - platform: iOS - device: iPhone 13 - - setup_macos_executor - - run: - command: yarn install --frozen-lockfile - name: yarn install - - pod_install - - run: - command: yarn e2e:build:ios:release - name: build for detox - - run: - command: yarn e2e:test:ios:release - name: test detox - - store_test_results: - path: junit.xml - - store_artifacts: - path: ./artifacts - - e2e-android: - executor: - name: android/android-machine - tag: 2021.10.1 - steps: - - setup_android_executor - - android_emulator_start - - run: - command: yarn install --frozen-lockfile - name: yarn install - - android/restore-gradle-cache - - android/restore-build-cache - - run: - command: yarn e2e:build:android:release - name: build for detox - - android/save-gradle-cache - - android/save-build-cache - - run: - no_output_timeout: 60m - command: yarn e2e:test:android:release - name: test detox - - store_test_results: - path: junit.xml - - store_artifacts: - path: ./artifacts - - deploy-firebase-android: - executor: - name: android/android-machine - tag: 2021.10.1 - steps: - - setup_android_executor - - ruby/install-deps: - key: -gems-{{ arch }}-v1 - - run: - name: Install Firebase CLI - command: | - curl -Lo ./firebase_bin https://firebase.tools/bin/linux/v10.2.2 - - run: - command: yarn install --frozen-lockfile - name: yarn install - - run: - name: "Increment dev app version" - command: | - bundle exec fastlane increment_version app_id:$FIREBASE_APP_ID_ANDROID version_suffix:$VERSION_SUFFIX - - android/restore-gradle-cache - - android/restore-build-cache - - run: - command: yarn dev-app:build:android:release - name: build - - android/save-gradle-cache - - android/save-build-cache - - run: - name: "Deploy dev app to Firebase" - command: | - bundle exec fastlane publish_to_firebase app_id:$FIREBASE_APP_ID_ANDROID firebase_token:$FIREBASE_TOKEN - -workflows: - version: 2 - build-and-test: - jobs: - - install-dependencies - - lint: - requires: - - install-dependencies - - typescript: - requires: - - install-dependencies - - unit-js: - requires: - - install-dependencies - - unit-android: - requires: - - install-dependencies - - example-build-ios: - requires: - - install-dependencies - - example-build-android: - requires: - - install-dependencies - - e2e-android: - context: - - stripe-terminal-react-native-android-test - requires: - - install-dependencies - - e2e-ios: - requires: - - install-dependencies - - deploy-firebase-android: - context: - - stripe-terminal-react-native-US-example-app - name: deploy-firebase-android-us - requires: - - install-dependencies - filters: - branches: - only: - - main diff --git a/.npmignore b/.npmignore index c8aca850..104d9a87 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ *.log -.circleci .detoxrc.json .env .github diff --git a/dev-app/src/Root.tsx b/dev-app/src/Root.tsx index 44650d9e..9ca6fd34 100644 --- a/dev-app/src/Root.tsx +++ b/dev-app/src/Root.tsx @@ -18,7 +18,7 @@ export default function Root() { >(null); useEffect(() => { - // var is a string in CircleCI + // var is a string in CI if (process.env.IS_CI === 'true') { clearMerchantStorage(); }