Skip to content

feat: defi positions migration to ListPositions endpoint #2240

feat: defi positions migration to ListPositions endpoint

feat: defi positions migration to ListPositions endpoint #2240

Workflow file for this run

name: Android
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- develop
jobs:
build:
name: Test Build
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
concurrency:
group: e2e-android-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
outputs:
artifact-id: ${{ steps.rock-remote-build-android.outputs.artifact-id }}
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Install secret tools
run: sudo apt install libsecret-tools
- name: Setup env key
uses: ./.github/actions/ssh/
with:
name: env
key: ${{ secrets.DEPLOY_PKEY_DOTENV_REPO }}
- name: Setup scripts key
uses: ./.github/actions/ssh/
with:
name: scripts
key: ${{ secrets.DEPLOY_PKEY_SCRIPTS_REPO }}
- name: Setup sandbox key
uses: ./.github/actions/ssh/
with:
name: sandbox
key: ${{ secrets.DEPLOY_PKEY_SANDBOX_REPO }}
- name: Setup env
env:
SSH_AUTH_SOCK: /tmp/ssh_agent_env.sock
run: |
git clone [email protected]:rainbow-me/rainbow-env.git
mv rainbow-env/dotenv .env
mv rainbow-env/android/app/google-services.json android/app/google-services.json
rm -rf rainbow-env
sed -i "s/IS_TESTING=false/IS_TESTING=true/" .env
echo "1" > is_testing
- name: Setup scripts
env:
CI_SCRIPTS: ${{ secrets.CI_SCRIPTS }}
SSH_AUTH_SOCK: /tmp/ssh_agent_scripts.sock
run: |
eval $CI_SCRIPTS
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.yarn/cache
.yarn/install-state.gz
key: ${{ runner.os }}-${{ runner.arch }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
env:
SSH_AUTH_SOCK: /tmp/ssh_agent_sandbox.sock
run: |
yarn install && yarn setup
- name: Check for frozen lockfile
run: ./scripts/check-lockfile.sh
- name: Audit CI
run: yarn audit-ci --config audit-ci.jsonc
- name: Rock Remote Build - Android
id: rock-remote-build-android
uses: callstackincubator/android@8c2cb70c209cc7f832130b6e49bcbcaa7ad62613
env:
# This is a debug keystore for now.
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
variant: release
sign: true
keystore-base64: ${{ env.KEYSTORE_BASE64 }}
keystore-store-file: ${{ env.KEYSTORE_FILE }}
keystore-store-password: ${{ env.KEYSTORE_PASSWORD }}
keystore-key-alias: ${{ env.KEYSTORE_KEY_ALIAS }}
keystore-key-password: ${{ env.KEYSTORE_KEY_PASSWORD }}
re-sign: true
github-token: ${{ secrets.GITHUB_TOKEN }}
validate-gradle-wrapper: false
rock-build-extra-params: '--extra-params="--no-daemon --build-cache --no-scan"'
comment-bot: false
e2e-tests:
name: E2E Tests (Shard ${{ matrix.shard-index }})
strategy:
fail-fast: false
matrix:
shard-index: [1, 2, 3, 4]
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: app-e2e-runner
needs: build
timeout-minutes: 30
concurrency:
group: e2e-android-${{ github.workflow }}-${{ github.ref }}-shard-${{ matrix.shard-index }}
cancel-in-progress: false
env:
SHARD_TOTAL: 4
SHARD_INDEX: ${{ matrix.shard-index }}
ANDROID_EMULATOR_API_LEVEL: 31
ANDROID_EMULATOR_PROFILE: pixel_6
ANDROID_EMULATOR_CORES: 4
ANDROID_EMULATOR_RAM_SIZE: 8192
ARTIFACTS_FOLDER: e2e-artifacts
ARCH: x86_64
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 60
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Setup env key
uses: ./.github/actions/ssh/
with:
name: env
key: ${{ secrets.DEPLOY_PKEY_DOTENV_REPO }}
- name: Setup env
env:
SSH_AUTH_SOCK: /tmp/ssh_agent_env.sock
run: |
git clone [email protected]:rainbow-me/rainbow-env.git
mv rainbow-env/dotenv .env
rm -rf rainbow-env
- name: Install Maestro
run: export MAESTRO_VERSION=2.0.3; curl -fsSL "https://get.maestro.mobile.dev" | bash
- name: Install Anvil
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de
with:
version: stable
- name: Download and Unpack APK artifact
run: |
curl -L -H "Authorization: token ${{ github.token }}" -o artifact.zip "https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${{ needs.build.outputs.artifact-id }}/zip"
unzip artifact.zip -d downloaded-artifacts
ls -l downloaded-artifacts
APK_PATH=$(find downloaded-artifacts -name "*.apk" -print -quit)
echo "ARTIFACT_PATH_FOR_E2E=$APK_PATH" >> $GITHUB_ENV
shell: bash
- name: Setup Android Emulator
id: android-emulator
uses: ./.github/actions/android-emulator/
with:
api-level: ${{ env.ANDROID_EMULATOR_API_LEVEL }}
profile: ${{ env.ANDROID_EMULATOR_PROFILE }}
cores: ${{ env.ANDROID_EMULATOR_CORES }}
ram-size: ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
arch: ${{ env.ARCH }}
- name: Run tests
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed
id: e2e_test
with:
api-level: ${{ env.ANDROID_EMULATOR_API_LEVEL }}
target: google_apis_playstore
arch: ${{ env.ARCH }}
force-avd-creation: false
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
profile: ${{ env.ANDROID_EMULATOR_PROFILE }}
cores: ${{ env.ANDROID_EMULATOR_CORES }}
ram-size: ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
script: ./scripts/e2e-android-ci.sh
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: artifacts-${{ matrix.shard-index }}
path: ${{ env.ARTIFACTS_FOLDER }}
perf-tests:
name: Perf Tests
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: build
timeout-minutes: 30
concurrency:
group: e2e-android-${{ github.workflow }}-${{ github.ref }}-perf
cancel-in-progress: true
env:
ARTIFACTS_FOLDER: e2e-artifacts
steps:
- name: Checkout repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Download and Unpack APK artifact
run: |
curl -L -H "Authorization: token ${{ github.token }}" -o artifact.zip "https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${{ needs.build.outputs.artifact-id }}/zip"
unzip artifact.zip -d downloaded-artifacts
ls -l downloaded-artifacts
APK_PATH=$(find downloaded-artifacts -name "*.apk" -print -quit)
echo "ARTIFACT_PATH_FOR_E2E=$APK_PATH" >> $GITHUB_ENV
shell: bash
- name: Run tests
run: ./scripts/e2e-android-perf-ci-aws.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DEVICE_FARM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEVICE_FARM_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
PROJECT_ARN: ${{ secrets.AWS_DEVICE_FARM_PROJECT_ARN }}
DEVICE_POOL_ARN: ${{ secrets.AWS_DEVICE_FARM_DEVICE_POOL_ARN }}
ARTIFACT_PATH_FOR_E2E: ${{ env.ARTIFACT_PATH_FOR_E2E }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Install Flashlight
if: github.event_name == 'pull_request'
run: |
curl https://get.flashlight.dev | bash
- name: Generate Report
if: github.event_name == 'pull_request'
run: ./scripts/e2e-android-perf-ci-report.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_COMMIT: ${{ github.sha }}
- name: Upload Current Perf JSON
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: perf-results-${{ github.event.pull_request.number || github.ref_name }}
path: ${{ env.ARTIFACTS_FOLDER }}/perf