Expose MSDK's KlarnaStandaloneWebView as a React Native component #12
Workflow file for this run
This file contains 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: Integration Tests | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test-android: | |
name: Android Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT | |
id: extract_branch | |
# clone the repo to workspace | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Cache turborepo for Android | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.TURBO_CACHE_DIR }} | |
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-turborepo-android- | |
- name: Check turborepo cache for Android | |
run: | | |
TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") | |
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | |
echo "turbo_cache_hit=1" >> $GITHUB_ENV | |
fi | |
# setup JDK environment | |
- name: Set up our JDK environment | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Finalize Android SDK | |
if: env.turbo_cache_hit != 1 | |
run: | | |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | |
- name: Cache Gradle | |
if: env.turbo_cache_hit != 1 | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/wrapper | |
~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('TestApp/android/gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Bundle JS for Android | |
run: mkdir TestApp/android/app/src/main/assets && yarn TestApp bundle:android | |
- name: Build TestApp for Android | |
run: | | |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" | |
## make gradlew executable in ci | |
- name: Make Gradlew Executable | |
run: cd integration-tests && chmod +x ./gradlew | |
- name: Upload Android Test App for Integration Tests | |
env: | |
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }} | |
BROWSERSTACK_PASSWORD: ${{ secrets.BROWSERSTACK_PASSWORD }} | |
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} | |
run: curl -u $BROWSERSTACK_USER:$BROWSERSTACK_PASSWORD -X POST https://api-cloud.browserstack.com/app-automate/upload -F file=@TestApp/android/app/build/outputs/apk/debug/app-debug.apk -F "data={\"custom_id\":\"INAPP_RN_SDK_ANDROID_TEST_APP\"}" | |
- name: Run Android Integration Tests | |
env: | |
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }} | |
BROWSERSTACK_PASSWORD: ${{ secrets.BROWSERSTACK_PASSWORD }} | |
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} | |
run: ./integration-tests/gradlew -p integration-tests :test --tests TestSuite -Dbrowserstack.username="$BROWSERSTACK_USER" -Dbrowserstack.password="$BROWSERSTACK_PASSWORD" -Dbuild.name="$BRANCH_NAME@$GITHUB_SHA" -Dbuild.platform="Android" | |