tests: switch to fw main branch #14
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
name: suite-native develop ci | |
on: | |
push: | |
branches: | |
- develop | |
paths: | |
- "suite-native/**" | |
- "packages/icons/**" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
android_develop: | |
runs-on: ubuntu-latest | |
environment: develop | |
timeout-minutes: 45 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Setup react-native kernel and increase watchers | |
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
- name: Decode files | |
env: | |
ENCODED_STRING_KEYSTORE: ${{ secrets.DEVELOP_KEYSTORE_FILE }} | |
ENCODED_STRING_JSON_FILE: ${{secrets.GOOGLE_PLAY_JSON_KEY}} | |
run: | | |
echo $ENCODED_STRING_KEYSTORE | base64 -d > suite-native/app/android/app/release.keystore | |
echo $ENCODED_STRING_JSON_FILE > suite-native/app/android/firebase_key.json | |
- name: Install dependecies | |
run: yarn install | |
- name: Build JS libs | |
run: yarn build:libs | |
- name: Ruby Setup for Fastlane | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2.1" | |
bundler-cache: true | |
- name: Install bundler | |
working-directory: suite-native/app/ | |
run: gem install bundler | |
- name: Fastlane build and deploy | |
working-directory: suite-native/app/ | |
env: | |
SIGNING_KEY_FILE: release.keystore | |
SIGNING_KEY_STORE_PASSWORD: ${{ secrets.SIGNING_KEY_STORE_PASSWORD }} | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
GOOGLE_PLAY_JSON_KEY_FILE: ./android/firebase_key.json | |
FIREBASE_APP_ID: ${{secrets.ANDROID_FIREBASE_APP_ID}} | |
# builds and publishes the app | |
run: | | |
bundle install | |
bundle exec fastlane android develop | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: app-apk | |
path: | | |
suite-native/app/android/**/*.apk | |
maestro_tests: | |
needs: android_develop | |
runs-on: ubuntu-latest | |
environment: develop | |
timeout-minutes: 45 | |
steps: | |
- name: install Maestro | |
run: | | |
curl -Ls "https://get.maestro.mobile.dev" | bash | |
- name: get android APK for tests | |
uses: actions/download-artifact@v2 | |
with: | |
name: app-apk | |
path: suite-native/app/android | |
- name: install the apk via adb | |
run: | | |
adb install -r suite-native/app/android/app/build/outputs/apk/firebaseDevelop/release/app-firebaseDevelop-release.apk | |
- name: move to the tests directory | |
run: cd suite-native/app/.maestro | |
- name: run the tests on an emulator | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 33 | |
script: maestro test importBTCviaText.yaml | |
ios_develop: | |
runs-on: macos-12 | |
environment: develop | |
timeout-minutes: 75 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | |
- name: Restore yarn cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | |
restore-keys: | | |
yarn-cache-folder- | |
- name: Decode files | |
env: | |
APPSTORE_CERTIFICATE_CONTENT: ${{ secrets.APPSTORE_CERTIFICATE_CONTENT }} | |
run: | | |
echo $APPSTORE_CERTIFICATE_CONTENT | base64 -d > suite-native/app/TrezorDistributionCertificate.p12 | |
- name: Install missing Python deps (to build bcrypto lib in Node) | |
run: pip install setuptools | |
- name: Install dependecies | |
run: | | |
yarn install | |
yarn build:libs | |
yarn workspace @trezor/suite-native pods | |
- name: Ruby Setup for Fastlane | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2.1" | |
bundler-cache: true | |
- name: Install bundler | |
working-directory: suite-native/app/ | |
run: gem install bundler | |
- name: Fastlane build and deploy | |
working-directory: suite-native/app/ | |
env: | |
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }} | |
APPSTORE_KEY_ISSUER_ID: ${{ secrets.APPSTORE_KEY_ISSUER_ID }} | |
APPSTORE_KEY_FILE_CONTENT: ${{ secrets.APPSTORE_KEY_FILE_CONTENT }} | |
APPSTORE_CERTIFICATE_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATE_PASSWORD }} | |
TMP_KEYCHAIN_NAME: ${{ secrets.TMP_KEYCHAIN_NAME }} | |
TMP_KEYCHAIN_PASSWORD: ${{ secrets.TMP_KEYCHAIN_PASSWORD }} | |
# builds and publishes the app | |
run: | | |
bundle install | |
bundle exec fastlane ios develop |