Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
trying with android staging ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilchrist-ledger committed May 2, 2022
1 parent f0432ad commit 9964d83
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 19 deletions.
1 change: 1 addition & 0 deletions .detoxrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"ios.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/ledgerlivemobile.app",
Expand Down
74 changes: 60 additions & 14 deletions .github/workflows/detox-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ on:
required: true

jobs:
# prepare-test-run:
# name: "Prepare test run"
# runs-on: macos-latest
# steps:
# - name: prepare runner
# run:

ios:
# needs: [prepare-test-run]
runs-on: macos-latest
steps:
- name: Checkout PR
Expand All @@ -28,9 +20,6 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -41,9 +30,6 @@ jobs:
run: |
brew tap wix/brew
brew install applesimutils
- name: List sims
run: applesimutils --list
- name: Setup Node
uses: actions/setup-node@v2
Expand Down Expand Up @@ -88,3 +74,63 @@ jobs:
with:
name: test-ios-artifacts
path: artifacts

android:
runs-on: macos-latest
steps:
- name: Checkout PR
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'

- name: Check hash commit deps
uses: ledgerhq/actions/packages/has-hash-commit-deps@main
id: has-hash-commit-deps
with:
workspace: ${{ github.workspace }}

- name: Install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'true' }}
env:
JOBS: max
run: yarn --prefer-offline --frozen-lockfile --network-timeout 100000 --network-concurrency 1

- name: install dependencies
if: ${{ steps.has-hash-commit-deps.outputs.has-hash-commit-deps == 'false' }}
env:
JOBS: max
run: yarn --prefer-offline --frozen-lockfile --network-timeout 100000

- name: Build Android app for Detox test run
env:
NODE_OPTIONS: "--max-old-space-size=7168"
run: yarn e2e:build -c android.emulator

- name: Run Android tests
timeout-minutes: 10
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
# force-avd-creation: false
avd-name: Nexus_6_API_30
emulator-options: -verbose -no-boot-anim -noaudio
ram-size: 2048
script: |
mkdir ./temp
curl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk
adb install ./temp/test-butler-app.apk || adb install ./e2e/test-butler-app.apk
yarn e2e:test -c android.emulator --loglevel verbose --record-logs failing --record-timeline all --take-screenshots all --record-videos failing --detectOpenHandles
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: test-android-artifacts
path: artifacts
10 changes: 5 additions & 5 deletions e2e/bridge/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ export async function loadConfig(
acceptTerms();
}

console.log("==========> starting file sync");
log("starting file sync");
const f = fs.readFileSync(path.resolve("e2e", "setups", `${fileName}.json`));
// $FlowFixMe
console.log("==========> parsing JSON");
log("parsing JSON");
const { data } = JSON.parse(f);

console.log("==========> post message");
log("post message");
postMessage({ type: "importSettngs", payload: data.settings });

console.log("==========> navigating to portfolio");
log("navigating to portfolio");
navigate(NavigatorName.Base);

console.log("==========> importing accounts");
log("importing accounts");
if (data.accounts.length) {
postMessage({ type: "importAccounts", payload: data.accounts });
// await $waitFor("PortfolioAccountsList", -1, 10000);
Expand Down

0 comments on commit 9964d83

Please sign in to comment.