Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add debug info for detox tests #9149

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 57 additions & 57 deletions .github/workflows/test-mobile-e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
id: caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
with:
skip-pod-cache: "true"
skip-pod-cache: "false"
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
Expand All @@ -108,62 +108,62 @@ jobs:
timeout_minutes: 15
command: pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm
new_command_on_retry: rm -rf ~/.cocoapods/ && pnpm clean && pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --no-frozen-lockfile --unsafe-perm
- name: cache detox build
uses: tespkg/actions-cache@v1
if: steps.aws.conclusion == 'success'
id: detox-build
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile/ios/build/Build/Products/Release-iphonesimulator
key: ${{ runner.os }}-detox-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock', 'apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj', 'apps/ledger-live-mobile/detox.config.js', 'apps/ledger-live-mobile/.env.mock', 'apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm') }}
accessKey: ${{ env.AWS_ACCESS_KEY_ID }}
secretKey: ${{ env.AWS_SECRET_ACCESS_KEY }}
sessionToken: ${{ env.AWS_SESSION_TOKEN}}
bucket: ll-gha-s3-cache
region: ${{ secrets.AWS_CACHE_REGION }}
use-fallback: false
- name: Build dependencies
run: |
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
- name: Build Dummy Live SDK and Dummy Wallet API apps for testing
run: |
pnpm build:dummy-apps
shell: bash
- name: Create iOS simulator
id: simulator
run: |
ID=$(xcrun simctl create "iOS Simulator" "iPhone 15")
echo "id=$ID" >> $GITHUB_OUTPUT
- name: Build iOS app for Detox test run
if: steps.detox-build.outputs.cache-hit != 'true'
run: pnpm mobile e2e:ci -p ios -b
- name: Build JS Bundle app for Detox test run
if: steps.detox-build.outputs.cache-hit == 'true'
run: pnpm mobile e2e:ci -p ios --bundle
- name: Setup Speculos image and Coin Apps
if: ${{ env.SPECULOS_RUN == 'true' }}
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop
with:
coinapps_path: ${{ env.COINAPPS }}
speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }}
bot_id: ${{ secrets.GH_BOT_APP_ID }}
bot_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- name: Test iOS app
id: detox
timeout-minutes: 75
run: pnpm mobile e2e:ci -p ios -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos')
env:
SEED: ${{ secrets.SEED_QAA_B2C }}
INPUT_SPECULOS: ${{ env.SPECULOS_RUN }}
- name: Delete iOS simulator
if: ${{ always() && steps.simulator.outputs.id }}
run: |
xcrun simctl delete ${{ steps.simulator.outputs.id }}
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() || steps.detox.outcome == 'cancelled' }}
with:
name: "ios-test-artifacts"
path: apps/ledger-live-mobile/artifacts
# - name: cache detox build
# uses: tespkg/actions-cache@v1
# if: steps.aws.conclusion == 'success'
# id: detox-build
# with:
# path: ${{ github.workspace }}/apps/ledger-live-mobile/ios/build/Build/Products/Release-iphonesimulator
# key: ${{ runner.os }}-detox-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock', 'apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj', 'apps/ledger-live-mobile/detox.config.js', 'apps/ledger-live-mobile/.env.mock', 'apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm') }}
# accessKey: ${{ env.AWS_ACCESS_KEY_ID }}
# secretKey: ${{ env.AWS_SECRET_ACCESS_KEY }}
# sessionToken: ${{ env.AWS_SESSION_TOKEN}}
# bucket: ll-gha-s3-cache
# region: ${{ secrets.AWS_CACHE_REGION }}
# use-fallback: false
# - name: Build dependencies
# run: |
# pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
# - name: Build Dummy Live SDK and Dummy Wallet API apps for testing
# run: |
# pnpm build:dummy-apps
# shell: bash
# - name: Create iOS simulator
# id: simulator
# run: |
# ID=$(xcrun simctl create "iOS Simulator" "iPhone 15")
# echo "id=$ID" >> $GITHUB_OUTPUT
# - name: Build iOS app for Detox test run
# if: steps.detox-build.outputs.cache-hit != 'true'
# run: pnpm mobile e2e:ci -p ios -b
# - name: Build JS Bundle app for Detox test run
# if: steps.detox-build.outputs.cache-hit == 'true'
# run: pnpm mobile e2e:ci -p ios --bundle
# - name: Setup Speculos image and Coin Apps
# if: ${{ env.SPECULOS_RUN == 'true' }}
# uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop
# with:
# coinapps_path: ${{ env.COINAPPS }}
# speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }}
# bot_id: ${{ secrets.GH_BOT_APP_ID }}
# bot_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
# - name: Test iOS app
# id: detox
# timeout-minutes: 75
# run: pnpm mobile e2e:ci -p ios -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos')
# env:
# SEED: ${{ secrets.SEED_QAA_B2C }}
# INPUT_SPECULOS: ${{ env.SPECULOS_RUN }}
# - name: Delete iOS simulator
# if: ${{ always() && steps.simulator.outputs.id }}
# run: |
# xcrun simctl delete ${{ steps.simulator.outputs.id }}
# - name: Upload test artifacts
# uses: actions/upload-artifact@v4
# if: ${{ !cancelled() || steps.detox.outcome == 'cancelled' }}
# with:
# name: "ios-test-artifacts"
# path: apps/ledger-live-mobile/artifacts

allure-report-ios:
name: "Allure Reports Export on Server"
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ For a smooth and quick integration:
- See the developers’ documentation on the [Developer Portal](https://developers.ledger.com/docs/coin/general-process/) and
- Go on [Discord](https://developers.ledger.com/discord-pro/) to chat with developer support and the developer community.

---
---
13 changes: 11 additions & 2 deletions apps/ledger-live-mobile/scripts/post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ function runHashChecks(writeCache = false) {
const lock = join(__dirname, "..", "ios", "Podfile.lock");
const pkg = join(__dirname, "..", "package.json");

if (!existsSync(pods)) return false;
if (!existsSync(pods)) {

echo(chalk.yellow("DEBUG pods don't exist"));

return false;
}

const podsHash = computeMetaHash([pods]);
const lockHash = computeMetaHash([lock]);
Expand All @@ -68,6 +73,9 @@ function runHashChecks(writeCache = false) {

const cache = getCache(cachePath);

echo(chalk.yellow("DEBUG cache:" + JSON.stringify(cache)));
echo(chalk.yellow("DEBUG result:" + JSON.stringify(result)));

if (!cache || writeCache) {
try {
const data = JSON.stringify(result);
Expand Down Expand Up @@ -167,7 +175,8 @@ BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"`;
|\\_/|
\\___/
`;
echo(chalk.red(str));
echo(chalk.yellow(str));
echo(chalk.red(error));
await $`exit 1`;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
"@ledgerhq/pnpm-utils": "workspace:*",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"chalk": "4.1.2",
"eslint": "8.57.0",
"chalk": "4.1.2",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-prettier": "5.1.3",
Expand Down
Loading