diff --git a/.github/workflows/appium-automation.yml b/.github/workflows/appium-automation.yml index 85108ac96..0e4ad9962 100644 --- a/.github/workflows/appium-automation.yml +++ b/.github/workflows/appium-automation.yml @@ -21,7 +21,14 @@ jobs: uses: actions/checkout@v3 with: path: sdk + ref: ${{ github.ref }} # point to automation master branch by default + - name: Checkout Master SDK repo with testbed app for Reinstallation tests + uses: actions/checkout@v3 + if: ${{ !( github.ref == 'refs/heads/master')}} + with: + path: previousVersionSDK + ref: Test-Automation-Improvements - name: Checkout qa automation uses: actions/checkout@v3 with: @@ -36,16 +43,54 @@ jobs: distribution: ${{ env.JAVA_DISTRIBUTION }} java-version: ${{ env.JAVA_VERSION }} # to reduce complexity, testbed app uses sdk as a project reference - - name: Build testbed app + - name: Decode Keystore + env: + ENCODED_STRING: ${{ secrets.KEYSTORE }} + run: | + cd sdk + echo $ENCODED_STRING | base64 -d > ./Branch-SDK-Automation-TestBed/automationSigningKeys.jks + cp ./Branch-SDK-Automation-TestBed/automationSigningKeys.jks ../previousVersionSDK/Branch-SDK-Automation-TestBed/ + ls -la + ls -la ./Branch-SDK-Automation-TestBed/ + - name: Build testbed app and Link Click Test App run: | cd sdk + ls -la + ls -la ./Branch-SDK-Automation-TestBed/ ./gradlew Branch-SDK-Automation-TestBed:assembleDebug + ./gradlew branchsdk-link-clicktest:assembleDebug + env: + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} + - name: Build Master testbed app for Reinstallation tests + if: ${{ !( github.ref == 'refs/heads/master')}} + run: | + cd previousVersionSDK + ./gradlew Branch-SDK-Automation-TestBed:assembleDebug + env: + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} - name: Upload APK to BrowserStack run: | response=$(curl -X POST https://api-cloud.browserstack.com/app-automate/upload -u "${{ secrets.BROWSER_STACK_USER }}:${{ secrets.BROWSER_STACK_KEY }}" -F "file=@sdk/Branch-SDK-Automation-TestBed/build/outputs/apk/debug/Branch-SDK-Automation-TestBed-debug.apk") parsed=$(echo $response | jq ".app_url") echo "::add-mask::$parsed" echo "BrowserStackAndroidNewBuildKey=$parsed" >> "$GITHUB_ENV" + - name: Upload Link Click Test App APK to BrowserStack + run: | + response=$(curl -X POST https://api-cloud.browserstack.com/app-automate/upload -u "${{ secrets.BROWSER_STACK_USER }}:${{ secrets.BROWSER_STACK_KEY }}" -F "file=@sdk/branchsdk-link-clicktest/build/outputs/apk/debug/branchsdk-link-clicktest-debug.apk") + parsed=$(echo $response | jq ".app_url") + echo "::add-mask::$parsed" + echo "BrowserStackLinkClickAppURL=$parsed" >> "$GITHUB_ENV" + - name: Upload APK from Master branch to BrowserStack for Reinstallation tests + if: ${{ !( github.ref == 'refs/heads/master')}} + run: | + response=$(curl -X POST https://api-cloud.browserstack.com/app-automate/upload -u "${{ secrets.BROWSER_STACK_USER }}:${{ secrets.BROWSER_STACK_KEY }}" -F "file=@previousVersionSDK/Branch-SDK-Automation-TestBed/build/outputs/apk/debug/Branch-SDK-Automation-TestBed-debug.apk") + parsed=$(echo $response | jq ".app_url") + echo "::add-mask::$parsed" + echo "BrowserStackAndroidOldBuildKey=$parsed" >> "$GITHUB_ENV" # automation is compatible with java 11 - name: Setup java for automation uses: actions/setup-java@v3 @@ -56,3 +101,9 @@ jobs: run: | cd qa mvn clean test -DsuiteXMLFile=testng.xml -e -DInputFormat="json" -DInputFilePath="TestSelection_BrowserStack_Android.json" -DUploadNewBuild="Yes" + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: test-results + path: | + qa/Results \ No newline at end of file