Skip to content

Commit

Permalink
(PC-18251) fix(e2e): add android GitHub action poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Kopriwa committed Oct 31, 2022
1 parent e4544e6 commit ac90804
Showing 1 changed file with 73 additions and 7 deletions.
80 changes: 73 additions & 7 deletions .github/workflows/e2e-android-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,80 @@ name: Tests e2e Android Native
on:
workflow_dispatch:
inputs:
tbd:
description: "tbd"
required: false
type: string
environment:
type: environment
description: Select the environment

jobs:
tbd:
e2e-android-native:
runs-on: ubuntu-latest
steps:
- name: Hello World
run: echo "Hello World"
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
# cache: 'maven'

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- uses: ruby/setup-ruby@v1
# with:
# bundler-cache: true

- name: Install dependencies
run: yarn

- name: Setup sentry credentials
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
echo "[defaults]" >> ~/.sentryclirc
echo "url=https://sentry.passculture.team/" >> ~/.sentryclirc
echo "org=sentry" >> ~/.sentryclirc
echo "project=application-native" >> ~/.sentryclirc
echo "" >> ~/.sentryclirc
echo "[auth]" >> ~/.sentryclirc
echo "token=$SENTRY_AUTH_TOKEN" >> ~/.sentryclirc
- name: Setup android keystore for ${{ inputs.environment }} environment
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }}
ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
run: |
mkdir -p android/keystores
echo ${ANDROID_KEYSTORE} | base64 -di > android/keystores/${{ inputs.environment }}.keystore
echo "keyAlias=passculture" >> android/keystores/${{ inputs.environment }}.keystore.properties
echo "storeFile=${{ inputs.environment }}.keystore" >> android/keystores/${{ inputs.environment }}.keystore.properties
echo "storePassword=${ANDROID_KEYSTORE_STORE_PASSWORD}" >> android/keystores/${{ inputs.environment }}.keystore.properties
echo "keyPassword=${ANDROID_KEYSTORE_KEY_PASSWORD}" >> android/keystores/${{ inputs.environment }}.keystore.properties
- name: Setup android Google services config
env:
ANDROID_GOOGLE_SERVICES_JSON: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON }}
run: echo ${ANDROID_GOOGLE_SERVICES_JSON} > android/app/google-services.json

- name: Build Android app for ${{ inputs.environment }} environment
run: |
source fastlane/.env.${{ inputs.environment }}
./android/gradlew ${ANDROID_GRADLE_TASK} -p android
- name: Install and run Appium 2 in the background
run: |
npm install -g appium@next
appium driver install uiautomator2
appium &
- name: Run e2e Android tests
run: |
source fastlane/.env.${{ inputs.environment }}
ANDROID_APK_PATH=${ANDROID_FILE_PATH} yarn test:e2e:android:native

0 comments on commit ac90804

Please sign in to comment.