Skip to content

feat: Implement BillingOptions for ApplePay #376

feat: Implement BillingOptions for ApplePay

feat: Implement BillingOptions for ApplePay #376

name: Android
on: pull_request
jobs:
android-distribute-to-appetize:
runs-on: ubuntu-latest
name: "Build and upload app to Appetize 🚀"
steps:
- name: Cancel previous jobs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
with:
access_token: ${{ github.token }}
- name: Set up JDK 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 17
distribution: 'corretto'
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b # v1.174.0
with:
ruby-version: "3.2"
bundler-cache: true
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
- name: Set legacy-peer-deps for npm config
run: |
npm config set legacy-peer-deps true
- name: Install packages
run: |
yarn install
- name: Distribute the React Native Android app on Appetize and upload to BrowserStack 🚀
run: bundle exec fastlane android appetize_build_and_upload
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_BRANCH: ${{ github.head_ref }}
APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }}
BROWSERSTACK_USERNAME: ${{secrets.BROWSERSTACK_USERNAME}}
BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}}
- name: Save Browserstack ID
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
id: save_browserstack_id_step
with:
name: browserstack_id
path: /var/tmp/browserstack_id.txt
if-no-files-found: error
- uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
if: ${{ success() }}
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Appetize Android link
- uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
if: ${{ success() }}
with:
body: |
Appetize Android link: ${{ env.APPETIZE_APP_URL }}
edit-mode: replace
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Slack Success Summary Report
if: ${{ success() && github.event.pull_request.base.ref == 'master' }}
run: |
node report-scripts/appetize-success-report-script.js createAppetizeSummaryReport ${{ github.head_ref || github.ref_name }} 'RN Android'
- name: Slack Success Notification
if: ${{ success() && github.event.pull_request.base.ref == 'master' }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
payload-file-path: '/var/tmp/appetize-success-link-summary.json'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Create Slack Failure Summary Report
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }}
run: |
node report-scripts/appetize-failure-report-script.js createAppetizeSummaryReport ${{ github.head_ref || github.ref_name }} 'RN Android'
- name: Slack Notification
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
payload-file-path: '/var/tmp/appetize-failure-link-summary.json'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
android-test-via-browserstack:
if: false # Re-enable when we have tests set up
runs-on: ubuntu-latest
name: "Test on BrowserStack"
needs: android-distribute-to-appetize
steps:
- name: Clone and launch Browserstack tests via Appium 🧪
run: |
git clone -b develop https://project_41483872_bot:$GITLAB_TEMP_PATH@gitlab.com/primer-io/dx/mobile-appium-tests.git .
env:
GITLAB_TEMP_PATH: ${{ secrets.GITLAB_APPIUM_PULL_KEY }}
- name: Retrieve Browserstack ID
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
name: browserstack_id
path: /var/tmp
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
- name: Add slack message builder
run: |
yarn add --ignore-workspace-root-check slack-message-builder
- name: Install packages
run: |
npm install
- name: Run Appium Test
env:
BROWSERSTACK_USERNAME: ${{secrets.BROWSERSTACK_USERNAME}}
BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}}
run: |
export BROWSERSTACK_APP_ID=$(cat /var/tmp/browserstack_id.txt)
npx wdio config/wdio.rn.android.bs.conf.js
- name: Create Slack Failed Summary Report
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }}
run: |
node report-scripts/slack-failed-report-script.js createSlackFailedSummaryReport ${{ steps.slack.outputs.thread_ts }}
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: Post detailed summary to Slack channel thread
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }}
id: slack_thread
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }}
payload-file-path: '/var/tmp/slack_failed_summary.json'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Create and post Github summary
if: ${{ success() || failure() }}
run: |
node report-scripts/github-tests-summary-script.js createGithubSummaryReport