mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-24 16:17:15 +01:00
171 lines
5.3 KiB
YAML
171 lines
5.3 KiB
YAML
name: "[Test] suite-native iOS E2E"
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
# FIXME:Disabled for now, iOS tests are failing
|
|
# push:
|
|
# branches:
|
|
# - release-native/*
|
|
workflow_dispatch:
|
|
inputs:
|
|
publish_results_to_github:
|
|
description: "Publish test report to GitHub Project"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NODE_ENV: "test"
|
|
DETOX_BINARY_PATH: ../../node_modules/.bin/detox
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
RN_SRC_EXT: "e2e.ts,e2e.tsx"
|
|
|
|
jobs:
|
|
prepare_ios_test_app:
|
|
if: github.repository == 'trezor/trezor-suite'
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout project
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: "true"
|
|
|
|
- name: Install node and yarn
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: yarn
|
|
|
|
- name: Setup node_modules cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: node_modules/${{ github.ref }}/${{github.run_id}}
|
|
|
|
- name: Install Yarn dependencies
|
|
run: |
|
|
echo -e "\nenableScripts: false" >> .yarnrc.yml
|
|
echo -e "\nenableHardenedMode: false" >> .yarnrc.yml
|
|
yarn install
|
|
|
|
- name: Prebuild native expo project
|
|
working-directory: ./suite-native/app
|
|
run: yarn prebuild --platform ios --clean
|
|
|
|
- name: Sign message system config
|
|
working-directory: ./suite-common/message-system
|
|
run: yarn sign-config
|
|
|
|
- name: Use latest stable Xcode
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: 16.1.0
|
|
|
|
- name: Build a Detox test app
|
|
working-directory: ./suite-native/app
|
|
run: $DETOX_BINARY_PATH build --configuration ios.sim.release
|
|
|
|
- name: Store build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ios-test-build
|
|
path: |
|
|
suite-native/app/ios/build/Build/Products/Release-iphonesimulator/TrezorSuiteLiteDebug.app
|
|
|
|
run_ios_e2e_tests:
|
|
runs-on: macos-latest
|
|
needs: prepare_ios_test_app
|
|
steps:
|
|
- name: Checkout project
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: "true"
|
|
|
|
- name: Install node and yarn
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: yarn
|
|
|
|
- name: Load node modules cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: node_modules/${{ github.ref }}/${{github.run_id}}
|
|
|
|
- name: Install Yarn dependencies
|
|
run: |
|
|
echo -e "\nenableScripts: false" >> .yarnrc.yml
|
|
echo -e "\nenableHardenedMode: false" >> .yarnrc.yml
|
|
yarn install
|
|
|
|
- name: Generate GitHub App token
|
|
id: trezor-bot-token
|
|
uses: actions/create-github-app-token@v1
|
|
with:
|
|
app-id: ${{ secrets.TREZOR_BOT_APP_ID }}
|
|
private-key: ${{ secrets.TREZOR_BOT_PRIVATE_KEY }}
|
|
|
|
# Used by github reporter when publishing results of release run
|
|
- name: Extract Release Build
|
|
id: extract_branch
|
|
shell: bash
|
|
run: |
|
|
echo "release_build=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}-${GITHUB_SHA:0:7}" >> $GITHUB_ENV
|
|
|
|
- name: Install macOS dependencies
|
|
run: |
|
|
brew tap wix/brew
|
|
brew install wix/brew/applesimutils
|
|
env:
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
|
|
|
- name: Download app build artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: ios-test-build
|
|
path: |
|
|
suite-native/app/ios/build/Build/Products/Release-iphonesimulator/TrezorSuiteLiteDebug.app
|
|
|
|
- name: Prepare iPhone 11 Simulator
|
|
run: xcrun simctl create "iPhone 11" com.apple.CoreSimulator.SimDeviceType.iPhone-11
|
|
|
|
- name: Run Detox E2E iOS tests
|
|
working-directory: ./suite-native/app
|
|
env:
|
|
PUBLISH_RESULTS_TO_GITHUB: ${{ inputs.publish_results_to_github == true }}
|
|
GITHUB_TOKEN: ${{ steps.trezor-bot-token.outputs.token }}
|
|
GITHUB_REPORTER_VERBOSE: false
|
|
RELEASE_BUILD: ${{ env.release_build }}
|
|
run: |
|
|
$DETOX_BINARY_PATH clean-framework-cache && $DETOX_BINARY_PATH build-framework-cache
|
|
yarn test:e2e ios.sim.release --headless --take-screenshots failing --record-videos failing
|
|
|
|
- name: Upload results to Currents.dev
|
|
if: ${{ ! cancelled() }}
|
|
env:
|
|
CURRENTS_PROJECT_ID: LjEjiV
|
|
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
|
|
working-directory: ./suite-native/app
|
|
run: |
|
|
npx currents convert \
|
|
--input-format=junit \
|
|
--input-file=./reports/junit-report.xml \
|
|
--output-dir=./currents \
|
|
--framework=postman \
|
|
--framework-version=v11.2.0
|
|
npx currents upload --project-id=${CURRENTS_PROJECT_ID} --key=${CURRENTS_RECORD_KEY} --report-dir ./currents
|
|
|
|
- name: "Store failed test screenshot artifacts"
|
|
if: ${{failure()}}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: failed-ios-tests
|
|
path: suite-native/app/artifacts
|