Repository navigation
fix: save contacts without repeated remote lookups #804
Workflow file for this run
This file contains hidden or 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: E2E Migration | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| e2e_branch: | |
| description: "Branch of synonymdev/bitkit-e2e-tests to use (main | default-feature-branch | custom branch name)" | |
| required: false | |
| default: "default-feature-branch" | |
| previous_native_version: | |
| description: "Archived native release tag (empty uses the pinned baseline)" | |
| required: false | |
| default: "" | |
| extended_rn: | |
| description: "Also run RN 1.1.6 passphrase and legacy-address cases" | |
| type: boolean | |
| default: false | |
| post_to_slack: | |
| description: "Post E2E migration summary to Slack (#bitkit-staging-nightly)" | |
| type: boolean | |
| required: false | |
| default: false | |
| schedule: | |
| - cron: "0 2 * * *" | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| env: | |
| TERM: xterm-256color | |
| FORCE_COLOR: 1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && (startsWith(github.head_ref, 'release-') || startsWith(github.base_ref, 'release-'))) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Java | |
| uses: actions/setup-java@v6 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Decode google-services.json | |
| run: | | |
| set -euo pipefail | |
| if [ -z "${GOOGLE_SERVICES_JSON_BASE64:-}" ]; then | |
| echo "GOOGLE_SERVICES_JSON_BASE64 is empty; using checked-in placeholder." | |
| exit 0 | |
| fi | |
| mkdir -p app/src/debug | |
| printf '%s' "$GOOGLE_SERVICES_JSON_BASE64" | base64 -d > app/src/debug/google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
| - name: Build debug app (regtest) | |
| env: | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CHATWOOT_API: ${{ secrets.CHATWOOT_API }} | |
| E2E: true | |
| E2E_BACKEND: network | |
| GEO: false | |
| run: ./gradlew assembleDevDebug | |
| - name: Rename APK | |
| run: | | |
| apk=$(find app/build/outputs/bitkit/devDebug -name 'bitkit-dev-debug-*-universal.apk') | |
| mv "$apk" app/build/outputs/bitkit/devDebug/bitkit_e2e.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: bitkit-e2e-apk_${{ github.run_number }} | |
| path: app/build/outputs/bitkit/devDebug/bitkit_e2e.apk | |
| e2e-branch: | |
| if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && (startsWith(github.head_ref, 'release-') || startsWith(github.base_ref, 'release-'))) | |
| uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main | |
| with: | |
| app_branch: ${{ github.head_ref || github.ref_name }} | |
| e2e_branch_input: ${{ github.event.inputs.e2e_branch || 'default-feature-branch' }} | |
| migration-plan: | |
| if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && (startsWith(github.head_ref, 'release-') || startsWith(github.base_ref, 'release-'))) | |
| needs: [e2e-branch] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.plan.outputs.version }} | |
| all: ${{ steps.plan.outputs.all }} | |
| rn: ${{ steps.plan.outputs.rn }} | |
| native: ${{ steps.plan.outputs.native }} | |
| steps: | |
| - name: Resolve E2E tests ref | |
| id: e2e-ref | |
| uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@main | |
| with: | |
| selected: ${{ needs.e2e-branch.outputs.branch }} | |
| e2e_branch_input: ${{ github.event.inputs.e2e_branch || 'default-feature-branch' }} | |
| - name: Checkout E2E tests | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: synonymdev/bitkit-e2e-tests | |
| ref: ${{ steps.e2e-ref.outputs.ref }} | |
| - name: Resolve migration cases and baseline | |
| id: plan | |
| run: python3 scripts/migration-matrix.py android | |
| env: | |
| PREVIOUS_NATIVE_VERSION: ${{ inputs.previous_native_version }} | |
| EXTENDED_RN: ${{ inputs.extended_rn || false }} | |
| e2e-tests: | |
| if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && (startsWith(github.head_ref, 'release-') || startsWith(github.base_ref, 'release-'))) | |
| runs-on: ubuntu-latest | |
| needs: [build, e2e-branch, migration-plan] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| scenario: ${{ fromJSON(needs.migration-plan.outputs.all) }} | |
| name: android - ${{ matrix.scenario.version }} - ${{ matrix.scenario.name }} | |
| env: | |
| BACKEND: regtest | |
| MIGRATION_EXTENDED: ${{ inputs.extended_rn || false }} | |
| steps: | |
| - name: Resolve E2E tests ref | |
| id: e2e-ref | |
| uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@main | |
| with: | |
| selected: ${{ needs.e2e-branch.outputs.branch }} | |
| e2e_branch_input: ${{ github.event.inputs.e2e_branch || 'default-feature-branch' }} | |
| - name: Clone E2E tests | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: synonymdev/bitkit-e2e-tests | |
| path: bitkit-e2e-tests | |
| ref: ${{ steps.e2e-ref.outputs.ref }} | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: AVD cache | |
| uses: actions/cache@v6 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| key: avd-33-x86_64-pixel_6 | |
| - name: Create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| profile: pixel_6 | |
| api-level: 33 | |
| arch: x86_64 | |
| avd-name: Pixel_6 | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | |
| disable-animations: false | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: Download APK | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: bitkit-e2e-apk_${{ github.run_number }} | |
| path: bitkit-e2e-tests/aut | |
| - name: Download migration source | |
| working-directory: bitkit-e2e-tests | |
| run: python3 scripts/download-migration-app.py android "$MIGRATION_SOURCE" "$MIGRATION_VERSION" | |
| env: | |
| MIGRATION_SOURCE: ${{ matrix.scenario.source }} | |
| MIGRATION_VERSION: ${{ matrix.scenario.version }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Cache npm cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| working-directory: bitkit-e2e-tests | |
| run: npm ci | |
| - name: Run E2E Tests 1 (${{ matrix.scenario.name }}) | |
| continue-on-error: true | |
| id: test1 | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| profile: pixel_6 | |
| api-level: 33 | |
| arch: x86_64 | |
| avd-name: Pixel_6 | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | |
| script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}" | |
| env: | |
| BACKEND: regtest | |
| RECORD_VIDEO: true | |
| ATTEMPT: 1 | |
| - name: Run E2E Tests 2 (${{ matrix.scenario.name }}) | |
| continue-on-error: true | |
| id: test2 | |
| if: steps.test1.outcome != 'success' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| profile: pixel_6 | |
| api-level: 33 | |
| arch: x86_64 | |
| avd-name: Pixel_6 | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | |
| script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}" | |
| env: | |
| BACKEND: regtest | |
| RECORD_VIDEO: true | |
| ATTEMPT: 2 | |
| - name: Run E2E Tests 3 (${{ matrix.scenario.name }}) | |
| id: test3 | |
| if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| profile: pixel_6 | |
| api-level: 33 | |
| arch: x86_64 | |
| avd-name: Pixel_6 | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | |
| script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.scenario.grep }}" | |
| env: | |
| BACKEND: regtest | |
| RECORD_VIDEO: true | |
| ATTEMPT: 3 | |
| - name: Upload E2E Artifacts (${{ matrix.scenario.name }}) | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: e2e-artifacts_${{ matrix.scenario.name }}_${{ matrix.scenario.version }}_${{ github.run_number }}_${{ github.run_attempt }} | |
| path: | | |
| bitkit-e2e-tests/artifacts/ | |
| !bitkit-e2e-tests/artifacts/**/*.env | |
| migration-result: | |
| if: always() && (github.event_name != 'pull_request' || (github.event.pull_request.draft == false && (startsWith(github.head_ref, 'release-') || startsWith(github.base_ref, 'release-')))) | |
| needs: [build, e2e-branch, migration-plan, e2e-tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require all migration jobs to succeed | |
| env: | |
| JOB_RESULTS: ${{ toJSON(needs) }} | |
| run: | | |
| python3 - <<'PYTHON' | |
| import json, os, sys | |
| failed = {name: job['result'] for name, job in json.loads(os.environ['JOB_RESULTS']).items() if job['result'] != 'success'} | |
| if failed: | |
| print(f'Migration failed or required jobs did not run: {failed}') | |
| sys.exit(1) | |
| PYTHON | |
| slack-report: | |
| if: >- | |
| always() && | |
| (github.event_name == 'schedule' || | |
| (github.event_name == 'workflow_dispatch' && inputs.post_to_slack == true)) | |
| needs: [build, e2e-branch, migration-plan, e2e-tests, migration-result] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Resolve E2E tests ref | |
| id: e2e-ref | |
| continue-on-error: true | |
| uses: synonymdev/bitkit-e2e-tests/.github/actions/resolve-e2e-ref@main | |
| with: | |
| selected: ${{ needs.e2e-branch.outputs.branch }} | |
| e2e_branch_input: ${{ github.event.inputs.e2e_branch || 'default-feature-branch' }} | |
| - name: Checkout E2E tests | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: synonymdev/bitkit-e2e-tests | |
| ref: ${{ steps.e2e-ref.outputs.ref || 'main' }} | |
| - name: Post Slack summary | |
| run: python3 scripts/slack_summary.py e2e-migration | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_STAGING }} | |
| PLATFORM: android | |
| MIGRATION_RESULT: ${{ needs.migration-result.result }} | |
| BUILD_RESULT: ${{ needs.build.result }} | |
| E2E_BRANCH_RESULT: ${{ needs.e2e-branch.result }} | |
| E2E_TESTS_RESULT: ${{ needs.e2e-tests.result }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| RUN_ATTEMPT: ${{ github.run_attempt }} | |
| E2E_TESTS_REF: ${{ steps.e2e-ref.outputs.ref }} |