-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
394 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
name: Android Preview | ||
|
||
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/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6" | ||
bundler-cache: true | ||
|
||
- uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
|
||
- name: Install npm | ||
run: | | ||
npm config set legacy-peer-deps true install | ||
- run: npm install --save slack-message-builder | ||
|
||
- name: Install packages | ||
run: | | ||
yarn | ||
- name: Distribute the React Native Android app on Appetize and upload to BrowserStack 🚀 | ||
run: bundle exec fastlane android preview | ||
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@v3 | ||
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@v2 | ||
if: ${{ success() }} | ||
id: find_comment | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body-includes: Appetize link | ||
|
||
- uses: peter-evans/create-or-update-comment@v2 | ||
if: ${{ success() }} | ||
with: | ||
body: | | ||
Appetize 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/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/appetize-success-link-summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_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/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/appetize-failure-link-summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
android-test-via-browserstack: | ||
runs-on: ubuntu-latest | ||
name: "Browserstack test" | ||
needs: android-distribute-to-appetize | ||
steps: | ||
- name: Clone and launch Browserstack tests via Appium 🧪 | ||
run: | | ||
git clone -b develop https://project_41483872_bot:[email protected]/primer-io/dx/mobile-appium-tests.git . | ||
env: | ||
GITLAB_TEMP_PATH: ${{ secrets.GITLAB_APPIUM_PULL_KEY }} | ||
|
||
- name: Retrieve Browserstack ID | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: browserstack_id | ||
path: /var/tmp | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.6" | ||
bundler-cache: true | ||
|
||
- uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
|
||
- name: Install npm | ||
run: | | ||
npm config set legacy-peer-deps true install | ||
- run: npm install --save slack-message-builder | ||
|
||
- name: Install packages | ||
run: | | ||
yarn | ||
- 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 Report | ||
if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} | ||
run: | | ||
node report-script/slack-report-script.js createSlackReport 'RN Android' | ||
- name: Post summary message to a Slack channel | ||
if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/slack-minimal_summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
- name: Create Slack Failed Summary Report | ||
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }} | ||
run: | | ||
node report-script/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/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/slack_failed_summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
- name: Create and post Github summary | ||
if: ${{ success() || failure() }} | ||
run: | | ||
node report-script/github-tests-summary-script.js createGithubSummaryReport | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,8 @@ jobs: | |
with: | ||
cache: 'yarn' | ||
|
||
- run: npm install --save slack-message-builder | ||
|
||
- name: Cache pods | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -89,10 +91,55 @@ jobs: | |
APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }} | ||
SOURCE_BRANCH: ${{ github.head_ref }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
||
- uses: peter-evans/find-comment@v2 | ||
if: ${{ success() }} | ||
id: find_comment | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body-includes: Appetize link | ||
|
||
- uses: peter-evans/create-or-update-comment@v2 | ||
if: ${{ success() }} | ||
with: | ||
body: | | ||
Appetize 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 iOS' | ||
- name: Slack Success Notification | ||
if: ${{ success() && github.event.pull_request.base.ref == 'master' }} | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/appetize-success-link-summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_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 iOS' | ||
- name: Slack Notification | ||
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }} | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/appetize-failure-link-summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
- name: Save Simulator app | ||
uses: actions/upload-artifact@v3 | ||
id: save_simulator_app_id_step | ||
with: | ||
name: PrimerSDK_Debug_Build | ||
path: /var/tmp/PrimerSDK_Debug_Build.zip | ||
if-no-files-found: error | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
name: iOS BS | ||
name: iOS BrowserStack | ||
on: pull_request | ||
jobs: | ||
|
||
|
@@ -56,6 +56,8 @@ jobs: | |
with: | ||
cache: 'yarn' | ||
|
||
- run: npm install --save slack-message-builder | ||
|
||
- name: Cache pods | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -138,3 +140,40 @@ jobs: | |
run: | | ||
export BROWSERSTACK_APP_ID=$(cat /var/tmp/browserstack_id.txt) | ||
npx wdio config/wdio.rn.ios.bs.conf.js | ||
- name: Create Slack Report | ||
if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} | ||
run: | | ||
node report-script/slack-report-script.js createSlackReport 'RN iOS' | ||
- name: Post summary message to a Slack channel | ||
if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/slack-minimal_summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
- name: Create Slack Failed Summary Report | ||
if: ${{ failure() && github.event.pull_request.base.ref == 'master' }} | ||
run: | | ||
node report-script/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/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | ||
payload-file-path: '/var/tmp/slack_failed_summary.json' | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | ||
|
||
- name: Create and post Github summary | ||
if: ${{ success() || failure() }} | ||
run: | | ||
node report-script/github-tests-summary-script.js createGithubSummaryReport |
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
Oops, something went wrong.