From e69423be65b227600e83acab03c944e2dd37c717 Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 14:31:04 +0200 Subject: [PATCH 01/11] chore: use macos 13 --- .github/workflows/e2e-android.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 08a9ee19de..967d36217d 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -1,11 +1,17 @@ name: Detox E2E Android -on: workflow_dispatch +on: + push: + paths: + - packages/mobile/** + - packages/backend/** + - packages/state-manager/** + - .github/workflows/e2e-android-self.yml jobs: detox-android: timeout-minutes: 25 - runs-on: [macos-latest-xlarge] + runs-on: [macos-13-xlarge] steps: - uses: actions/checkout@v4 @@ -76,13 +82,13 @@ jobs: - name: Stop metro run: pm2 stop METRO - - name: Take screenshot - if: always() - run: | # TODO + # - name: Take screenshot + # if: always() + # run: | # TODO - - name: Upload screenshot - if: always() - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: screenshot.png - path: screenshot.png + # - name: Upload screenshot + # if: always() + # uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + # with: + # name: screenshot.png + # path: screenshot.png From 33d70e0768fc856357193b2a0f1baa7dda5354f8 Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 14:34:05 +0200 Subject: [PATCH 02/11] chore: use workflow dispatch trigger --- .github/workflows/e2e-android.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 967d36217d..4a5b0d93f3 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -1,12 +1,6 @@ name: Detox E2E Android -on: - push: - paths: - - packages/mobile/** - - packages/backend/** - - packages/state-manager/** - - .github/workflows/e2e-android-self.yml +on: workflow_dispatch jobs: detox-android: From 25341682e7eea5996e2a8dfe04a4c40151e1138d Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 14:59:55 +0200 Subject: [PATCH 03/11] chore: use external script to write entitlements --- .github/scripts/write_entitlements.sh | 23 +++++++++++++++++ .github/workflows/e2e-android.yml | 37 +++++++++++++++------------ 2 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 .github/scripts/write_entitlements.sh diff --git a/.github/scripts/write_entitlements.sh b/.github/scripts/write_entitlements.sh new file mode 100644 index 0000000000..6b4ca680a2 --- /dev/null +++ b/.github/scripts/write_entitlements.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +# Modified from: +# https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error + +original_dir=$(pwd) +target_dir=~/Library/Android/sdk/emulator/qemu/darwin-aarch64 +file_path=entitlements.xml + +xml_content=' + + + + com.apple.security.hypervisor + + +' + +cd "$target_dir" +echo "$xml_content" > "$file_path" +codesign -s - --entitlements entitlements.xml --force ./qemu-system-aarch64 +cd "$original_dir" diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 4a5b0d93f3..dfab0c1f78 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -25,23 +25,26 @@ jobs: git lfs pull # see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - - name: Create qemu entitlements - run: | - { - echo '' - echo '' - echo '' - echo '' - echo ' com.apple.security.hypervisor' - echo ' ' - echo '' - echo '' - } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml - - - name: Re-sign qemu binary - run: | - cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 - codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose + # - name: Create qemu entitlements + # run: | + # { + # echo '' + # echo '' + # echo '' + # echo '' + # echo ' com.apple.security.hypervisor' + # echo ' ' + # echo '' + # echo '' + # } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml + + # - name: Re-sign qemu binary + # run: | + # cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 + # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose + + - name: Write entitlements + run: ./scripts/write_entitlements.sh - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' From 1788a40fbbd1f46cb47f767a2a430bcc691f4a9c Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 15:06:26 +0200 Subject: [PATCH 04/11] fix: correct script path --- .github/workflows/e2e-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index dfab0c1f78..527bb242ce 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -44,7 +44,7 @@ jobs: # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Write entitlements - run: ./scripts/write_entitlements.sh + run: ../scripts/write_entitlements.sh - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' From abeec5eb4f06da9583f7968139577cc1c23d8755 Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 15:11:51 +0200 Subject: [PATCH 05/11] fix: correct script path --- .github/workflows/e2e-android.yml | 2 +- {.github/scripts => scripts}/write_entitlements.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {.github/scripts => scripts}/write_entitlements.sh (100%) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 527bb242ce..dfab0c1f78 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -44,7 +44,7 @@ jobs: # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Write entitlements - run: ../scripts/write_entitlements.sh + run: ./scripts/write_entitlements.sh - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' diff --git a/.github/scripts/write_entitlements.sh b/scripts/write_entitlements.sh similarity index 100% rename from .github/scripts/write_entitlements.sh rename to scripts/write_entitlements.sh From ef118547e8b173f8a5649864c6c8de157bd5e040 Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 8 May 2024 15:17:11 +0200 Subject: [PATCH 06/11] fix: correct permissions --- scripts/write_entitlements.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/write_entitlements.sh diff --git a/scripts/write_entitlements.sh b/scripts/write_entitlements.sh old mode 100644 new mode 100755 From 79009ac401aa81f9b8161c3104c12b4c91c0fb11 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 9 May 2024 12:10:25 +0200 Subject: [PATCH 07/11] chore: restore previous entitlements --- .github/workflows/e2e-android.yml | 37 ++++++++++++++----------------- scripts/write_entitlements.sh | 23 ------------------- 2 files changed, 17 insertions(+), 43 deletions(-) delete mode 100755 scripts/write_entitlements.sh diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index dfab0c1f78..4a5b0d93f3 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -25,26 +25,23 @@ jobs: git lfs pull # see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - # - name: Create qemu entitlements - # run: | - # { - # echo '' - # echo '' - # echo '' - # echo '' - # echo ' com.apple.security.hypervisor' - # echo ' ' - # echo '' - # echo '' - # } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml - - # - name: Re-sign qemu binary - # run: | - # cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 - # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - - - name: Write entitlements - run: ./scripts/write_entitlements.sh + - name: Create qemu entitlements + run: | + { + echo '' + echo '' + echo '' + echo '' + echo ' com.apple.security.hypervisor' + echo ' ' + echo '' + echo '' + } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml + + - name: Re-sign qemu binary + run: | + cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 + codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' diff --git a/scripts/write_entitlements.sh b/scripts/write_entitlements.sh deleted file mode 100755 index 6b4ca680a2..0000000000 --- a/scripts/write_entitlements.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -# Modified from: -# https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - -original_dir=$(pwd) -target_dir=~/Library/Android/sdk/emulator/qemu/darwin-aarch64 -file_path=entitlements.xml - -xml_content=' - - - - com.apple.security.hypervisor - - -' - -cd "$target_dir" -echo "$xml_content" > "$file_path" -codesign -s - --entitlements entitlements.xml --force ./qemu-system-aarch64 -cd "$original_dir" From 7a6544005ab18a4dc81439e7290e19fa4224f6a1 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 9 May 2024 12:13:15 +0200 Subject: [PATCH 08/11] chore: skip overriding entitlements --- .github/workflows/e2e-android.yml | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 4a5b0d93f3..aa16881df5 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -25,23 +25,23 @@ jobs: git lfs pull # see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - - name: Create qemu entitlements - run: | - { - echo '' - echo '' - echo '' - echo '' - echo ' com.apple.security.hypervisor' - echo ' ' - echo '' - echo '' - } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml - - - name: Re-sign qemu binary - run: | - cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 - codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose + # - name: Create qemu entitlements + # run: | + # { + # echo '' + # echo '' + # echo '' + # echo '' + # echo ' com.apple.security.hypervisor' + # echo ' ' + # echo '' + # echo '' + # } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml + + # - name: Re-sign qemu binary + # run: | + # cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 + # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' From 42b3b5c97b3cbe87122e5e654d739985b1510a18 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 9 May 2024 12:42:56 +0200 Subject: [PATCH 09/11] Revert "chore: skip overriding entitlements" This reverts commit 7a6544005ab18a4dc81439e7290e19fa4224f6a1. --- .github/workflows/e2e-android.yml | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index aa16881df5..4a5b0d93f3 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -25,23 +25,23 @@ jobs: git lfs pull # see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - # - name: Create qemu entitlements - # run: | - # { - # echo '' - # echo '' - # echo '' - # echo '' - # echo ' com.apple.security.hypervisor' - # echo ' ' - # echo '' - # echo '' - # } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml - - # - name: Re-sign qemu binary - # run: | - # cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 - # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose + - name: Create qemu entitlements + run: | + { + echo '' + echo '' + echo '' + echo '' + echo ' com.apple.security.hypervisor' + echo ' ' + echo '' + echo '' + } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml + + - name: Re-sign qemu binary + run: | + cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 + codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a' From 854cc397517eccb2b66306ed996f11472093fcc5 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 9 May 2024 12:44:46 +0200 Subject: [PATCH 10/11] chore: try regular macos-13 --- .github/workflows/e2e-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 4a5b0d93f3..4f02f552d6 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -5,7 +5,7 @@ on: workflow_dispatch jobs: detox-android: timeout-minutes: 25 - runs-on: [macos-13-xlarge] + runs-on: [macos-13] steps: - uses: actions/checkout@v4 From b4ef68155183e86306190f8bab41332d63b6187b Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 9 May 2024 13:05:19 +0200 Subject: [PATCH 11/11] chore: skip entitlements --- .github/workflows/e2e-android.yml | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 4f02f552d6..d33a93e7c3 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -25,23 +25,23 @@ jobs: git lfs pull # see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error - - name: Create qemu entitlements - run: | - { - echo '' - echo '' - echo '' - echo '' - echo ' com.apple.security.hypervisor' - echo ' ' - echo '' - echo '' - } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml - - - name: Re-sign qemu binary - run: | - cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 - codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose + # - name: Create qemu entitlements + # run: | + # { + # echo '' + # echo '' + # echo '' + # echo '' + # echo ' com.apple.security.hypervisor' + # echo ' ' + # echo '' + # echo '' + # } >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml + + # - name: Re-sign qemu binary + # run: | + # cd $ANDROID_HOME/emulator/qemu/darwin-aarch64 + # codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose - name: Install SDK image run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a'