Skip to content

Latest commit

 

History

History
90 lines (55 loc) · 3.18 KB

TYRO_README.md

File metadata and controls

90 lines (55 loc) · 3.18 KB

Prerequisites

Must have:

  • Xcode
  • Android Studio
  • Ruby v3.3.x (use rbenv to manage ruby versions — project pins 3.3.11 via .ruby-version)
  • react-native-cli (npm install react-native-cli)

Getting Started

install dependencies by running:

  • npm run install:all

Setup for GooglePay SDK

Github Personal Access Token (PAT) is required to download the android package com.tyro.tyro-pay-android.

Steps to setup the PAT:

  • Navigate to GitHub page, Profile -> Settings -> Developer Settings
  • On the left panel, select Personal Access Token -> Token(classic)
  • Generate a new token with read:package permission
  • Configure the token: authorise it for organisation tyro
  • Store the new token as a environment variable: export GITHUB_PACKAGES_TOKEN={YOUR_GITHUB_TOKEN}

Run on ios and android

For android use java 11+

Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at 'tyro-pay-api-react-native/android/local.properties'. Then run: - npm run android

  • npm run ios

Running e2e Integration tests

Install Maestro:

Run Maestro to write e2e tests

https://maestro.mobile.dev/getting-started/maestro-studio

maestro studio

Running the tests:

  • npm run test:e2e:ios (make sure to start your iOS simulator before running npm run)
  • npm run test:e2e:android (make sure to start your android simulator before running)

For some tests that must be run on a real device, connect your mobile device to machine, and enable the developer options following these guides:

Then run the local tests:

  • npm run test:local:ios
  • npm run test:local:android

For testing GooglePay, you can add your google account on the device to the google group Google Pay API Test Cards Allowlist (https://groups.google.com/g/googlepay-test-mode-stub-data?pli=1) to enable test cards on the account.

Releasing the Package to GitHub Packages

Before releasing:

  • Checkout the branch 'version-bump' which would have the latest package version pushed to it.
  • Create a PR and have it reviewed/merged in.
  • Go to the main master branch on GitHub and click 'Create a new release' under 'Releases' on the left hand side of the page

Releasing:

  • If still prerelease check 'Set as pre-release' box, then write a description of the release and click 'Publish Release' when ready to release.
  • Check the GitHub Action ran to publish the release to GitHub Packages

Github Secrets

GITHUB_PACKAGES_USER: ${{ github.actor }} GITHUB_PACKAGES_TOKEN: ${{ secrets.PACKAGE_READ_PAT }}

These are managed by App Platform. When they expire they will need to create and upload new classic token for us.

We can tell it has expired by the build failing to fetch our native SDKs