From 450b8fcf16162e181e085f1427ec4aaeb024bb32 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Wed, 20 Sep 2023 15:49:29 +0100 Subject: [PATCH 01/20] Add compatibility testing files --- compat-testing/App.js | 18 ++ compat-testing/CheckoutScreen.js | 50 ++++++ compat-testing/test-config/wdio.ios.conf.js | 39 +++++ .../test-config/wdio.shared.conf.js | 165 ++++++++++++++++++ compat-testing/test/specs/status.spec.js | 12 ++ 5 files changed, 284 insertions(+) create mode 100644 compat-testing/App.js create mode 100644 compat-testing/CheckoutScreen.js create mode 100644 compat-testing/test-config/wdio.ios.conf.js create mode 100644 compat-testing/test-config/wdio.shared.conf.js create mode 100644 compat-testing/test/specs/status.spec.js diff --git a/compat-testing/App.js b/compat-testing/App.js new file mode 100644 index 000000000..727a2bb86 --- /dev/null +++ b/compat-testing/App.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { + SafeAreaView, + ScrollView +} from 'react-native'; +import CheckoutScreen from './CheckoutScreen'; + +const App = () => { + return ( + + + + + + ); +}; + +export default App; \ No newline at end of file diff --git a/compat-testing/CheckoutScreen.js b/compat-testing/CheckoutScreen.js new file mode 100644 index 000000000..e855106a9 --- /dev/null +++ b/compat-testing/CheckoutScreen.js @@ -0,0 +1,50 @@ +import * as React from 'react'; +import { + Primer, + PrimerSettings, + PrimerCheckoutData +} from '@primer-io/react-native'; +import { Text } from 'react-native'; + +const textStyles = { + margin: 36, + textAlign: 'center', + fontSize: 24 +}; + +const textColor = status => ({ color: status === 'Success!' ? 'green' : 'red' }) + + +const CheckoutScreen = (props) => { + + var [status, setStatus] = React.useState(); + + const onCheckoutComplete = (checkoutData) => { + // Perform an action based on the payment creation response + // ex. show success screen, redirect to order confirmation view, etc. + }; + + React.useEffect(() => { + const settings = { + onCheckoutComplete: onCheckoutComplete + }; + + Primer.configure(settings) + .then(() => { + // SDK is initialized sucessfully + setStatus("Success!") + }) + .catch (err => { + setStatus("Failure :-(") + }) + }, []); + + return ( + {status} + ); +}; + +export default CheckoutScreen; \ No newline at end of file diff --git a/compat-testing/test-config/wdio.ios.conf.js b/compat-testing/test-config/wdio.ios.conf.js new file mode 100644 index 000000000..fe45e8d13 --- /dev/null +++ b/compat-testing/test-config/wdio.ios.conf.js @@ -0,0 +1,39 @@ +const path = require("path"); +const { config } = require("./wdio.shared.conf"); + +// PORT +config.port = 4723; + +// SPECS +config.specs = [ + "./test/specs/*spec.js", + "./test/specs/**/*spec.js", + "../test/specs/*spec.js", + "../test/specs/**/*spec.js", +]; + +// CAPABILITIES +config.capabilities = [ + { + platformName: "IOS", + "appium:platformVersion": "16.4", + "appium:deviceName": "iPhone 14", + "appium:automationName": "XCUITest", + "appium:app": "/var/tmp/testapp.xcarchive/Products/Applications/testapp.app" + }, +]; + +config.services = [ + [ + "appium", + { + args: { + address: "localhost", + port: 4723, + }, + logPath: "./", + }, + ], +]; + +exports.config = config; diff --git a/compat-testing/test-config/wdio.shared.conf.js b/compat-testing/test-config/wdio.shared.conf.js new file mode 100644 index 000000000..e8bbcb859 --- /dev/null +++ b/compat-testing/test-config/wdio.shared.conf.js @@ -0,0 +1,165 @@ +exports.config = { + exclude: [], + + maxInstances: 1, + + logLevel: "error", + + bail: 0, + + baseUrl: "http://localhost", + + waitforTimeout: 10000, + + connectionRetryTimeout: 120000, + + connectionRetryCount: 3, + + framework: "mocha", + reporters: ["spec", ['json', { + outputDir: './test-results', + outputFileFormat: function (opts) { + return `results-${opts.cid}.${opts.capabilities}.json` + } +}], +], + + mochaOpts: { + ui: "bdd", + timeout: 60000, + }, + // + // ===== + // Hooks + // ===== + // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance + // it and to build services around it. You can either apply a single function or an array of + // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got + // resolved to continue. + /** + * Gets executed once before all workers get launched. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + */ + // onPrepare: function (config, capabilities) { + // }, + /** + * Gets executed before a worker process is spawned and can be used to initialise specific service + * for that worker as well as modify runtime environments in an async fashion. + * @param {String} cid capability id (e.g 0-0) + * @param {[type]} caps object containing capabilities for session that will be spawn in the worker + * @param {[type]} specs specs to be run in the worker process + * @param {[type]} args object that will be merged with the main configuration once worker is initialised + * @param {[type]} execArgv list of string arguments passed to the worker process + */ + // onWorkerStart: function (cid, caps, specs, args, execArgv) { + // }, + /** + * Gets executed just before initialising the webdriver session and test framework. It allows you + * to manipulate configurations depending on the capability or spec. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that are to be run + * @param {String} cid worker id (e.g. 0-0) + */ + // beforeSession: function (config, capabilities, specs, cid) { + // }, + /** + * Gets executed before test execution begins. At this point you can access to all global + * variables like `browser`. It is the perfect place to define custom commands. + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that are to be run + * @param {Object} browser instance of created browser/device session + */ + // before: function (capabilities, specs) { + // }, + /** + * Runs before a WebdriverIO command gets executed. + * @param {String} commandName hook command name + * @param {Array} args arguments that command would receive + */ + // beforeCommand: function (commandName, args) { + // }, + /** + * Hook that gets executed before the suite starts + * @param {Object} suite suite details + */ + // beforeSuite: function (suite) { + // }, + /** + * Function to be executed before a test (in Mocha/Jasmine) starts. + */ + // beforeTest: function (test, context) { + // }, + /** + * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling + * beforeEach in Mocha) + */ + // beforeHook: function (test, context) { + // }, + /** + * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling + * afterEach in Mocha) + */ + // afterHook: function (test, context, { error, result, duration, passed, retries }) { + // }, + /** + * Function to be executed after a test (in Mocha/Jasmine). + */ + // afterTest: function(test, context, { error, result, duration, passed, retries }) { + // }, + + /** + * Hook that gets executed after the suite has ended + * @param {Object} suite suite details + */ + // afterSuite: function (suite) { + // }, + /** + * Runs after a WebdriverIO command gets executed + * @param {String} commandName hook command name + * @param {Array} args arguments that command would receive + * @param {Number} result 0 - command success, 1 - command error + * @param {Object} error error object if any + */ + // afterCommand: function (commandName, args, result, error) { + // }, + /** + * Gets executed after all tests are done. You still have access to all global variables from + * the test. + * @param {Number} result 0 - test pass, 1 - test fail + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that ran + */ + // after: function (result, capabilities, specs) { + // }, + /** + * Gets executed right after terminating the webdriver session. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that ran + */ + // afterSession: function (config, capabilities, specs) { + // }, + /** + * Gets executed after all workers got shut down and the process is about to exit. An error + * thrown in the onComplete hook will result in the test run failing. + * @param {Object} exitCode 0 - success, 1 - fail + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + * @param {} results object containing test results + */ + onComplete: async function (exitCode, config, capabilities, results) { + const mergeResults = require('wdio-json-reporter/mergeResults') + const fs = require('fs'); + mergeResults('./test-results', 'results-*') +}, + + /** + * Gets executed when a refresh happens. + * @param {String} oldSessionId session ID of the old session + * @param {String} newSessionId session ID of the new session + */ + //onReload: function(oldSessionId, newSessionId) { + //} +}; diff --git a/compat-testing/test/specs/status.spec.js b/compat-testing/test/specs/status.spec.js new file mode 100644 index 000000000..bd12f399e --- /dev/null +++ b/compat-testing/test/specs/status.spec.js @@ -0,0 +1,12 @@ +describe("Status success", () => { + + const statusText = () => $(`id=status`); + + it('check status is success', async () => { + await statusText().waitForDisplayed({ timeout: 30000 }); + console.log(await statusText()) + const result = await statusText().getText(); + expect(result).toBe("Success!"); + }); + +}); \ No newline at end of file From f8e2a4827ad2e47240888d1fb3b34bcebf4fcf25 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Wed, 20 Sep 2023 17:32:59 +0100 Subject: [PATCH 02/20] Add shell script for compat test --- appium.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 appium.sh diff --git a/appium.sh b/appium.sh new file mode 100644 index 000000000..fb8c2edc5 --- /dev/null +++ b/appium.sh @@ -0,0 +1,44 @@ +# crutch for ruby (need to fix version to >=2.6) +rvm use 2.7.5 + +# Create the test app +npx react-native init testapp --version 0.70.8 + +# Install primer SDK +yarn --cwd testapp add @primer-io/react-native + +# Install pods +cd testapp/ios ; npx pod-install ; cd .. + +# Move compat testing files +cp -r ../compat-testing/* ./ + +# Install deps +yarn add --dev \ + appium appium-xcuitest-driver \ + appium-uiautomator2-driver \ + mocha-tags \ + @wdio/appium-service \ + @wdio/browserstack-service \ + @wdio/cli \ + @wdio/local-runner \ + @wdio/mocha-framework \ + @wdio/spec-reporter \ + wdio-json-reporter \ + @babel/cli \ + @babel/preset-env \ + @babel/register \ + typescript \ + ts-node + +# Build bundle and run once to link everything together +npx react-native run-ios + +# Kill any running appium server +pkill -f appium + +# Start appium server +nohup npx appium & + +# Run tests +npx wdio test-config/wdio.ios.conf.js From cf4ab4bb8dadb1872282c2bacbcff07e86674f54 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 21 Sep 2023 16:53:52 +0100 Subject: [PATCH 03/20] Add github workflow for compat test + add slack report script --- .github/workflows/ios-compat-testing.yml | 127 +++++++++++++++++++++++ appium.sh => bin/appium.sh | 3 - report-scripts/tests-report-script.js | 65 ++++++++++++ 3 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ios-compat-testing.yml rename appium.sh => bin/appium.sh (92%) mode change 100644 => 100755 create mode 100644 report-scripts/tests-report-script.js diff --git a/.github/workflows/ios-compat-testing.yml b/.github/workflows/ios-compat-testing.yml new file mode 100644 index 000000000..e8983f156 --- /dev/null +++ b/.github/workflows/ios-compat-testing.yml @@ -0,0 +1,127 @@ +--- +name: iOS Compatibility +on: pull_request +jobs: + ios-test-rn-version-compatibility: + name: Test react-native version compatibility + runs-on: macos-latest + strategy: + matrix: + version: ["0.70.8", "0.72.3"] + steps: + - name: Cancel previous jobs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa_github_actions + known_hosts: unnecessary + + - uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.6" + bundler-cache: true + + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Add slack message builder + run: | + yarn add slack-message-builder + + - name: Get npm cache directory + id: npm-cache-dir + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + + - name: Cache npm dependencies + uses: actions/cache@v3 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json', '*/*/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Set legacy-peer-deps for npm config + run: | + npm config set legacy-peer-deps true + + - name: Create test app + run: | + npx react-native init testapp --version ${{matrix.version}} + + - name: Install Primer SDK + run: | + yarn --cwd testapp add @primer-io/react-native + + - name: CocoaPods Install + run: | + cd testapp/ios ; npx pod-install ; cd .. + + - name: Move Testing Template Files + run: | + cp -r ../compat-testing/* ./ + + - name: Install Appium Packages + run: | + yarn add --dev \ + appium appium-xcuitest-driver \ + appium-uiautomator2-driver \ + mocha-tags \ + @wdio/appium-service \ + @wdio/browserstack-service \ + @wdio/cli \ + @wdio/local-runner \ + @wdio/mocha-framework \ + @wdio/spec-reporter \ + wdio-json-reporter \ + @babel/cli \ + @babel/preset-env \ + @babel/register \ + typescript \ + ts-node + + - name: Run iOS bundler and build + run: | + npx react-native run-ios + + - name: Start Appium Server + run: | + nohup npx appium & + + - name: Run Compatibility Tests + run: | + npx wdio test-config/wdio.ios.conf.js + + - name: Create Slack Report + if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} + run: | + node report-scripts/test-report-script.js createSlackReport iOS + + - name: Post summary message to a Slack channel + if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} + id: slack + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} + payload-file-path: '/var/tmp/slack-minimal_summary.json' + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file diff --git a/appium.sh b/bin/appium.sh old mode 100644 new mode 100755 similarity index 92% rename from appium.sh rename to bin/appium.sh index fb8c2edc5..188485636 --- a/appium.sh +++ b/bin/appium.sh @@ -1,6 +1,3 @@ -# crutch for ruby (need to fix version to >=2.6) -rvm use 2.7.5 - # Create the test app npx react-native init testapp --version 0.70.8 diff --git a/report-scripts/tests-report-script.js b/report-scripts/tests-report-script.js new file mode 100644 index 000000000..6c7645c2f --- /dev/null +++ b/report-scripts/tests-report-script.js @@ -0,0 +1,65 @@ +const fs = require('fs'); +const smb = require('slack-message-builder') + +const TEST_RESULTS_FILE_PATH = './testapp/test-results/wdio-merged.json' +const SUMMARY_FILE_PATH = '/var/tmp/slack-minimal_summary.json' + + +createSlackReport(process.argv[3]) + +function createSlackReport(platform) { + const json = JSON.parse(fs.readFileSync(TEST_RESULTS_FILE_PATH, "utf-8")); + + const suites = [...new Set(json.suites.map(suite => JSON.stringify(suite)))].map(suite => JSON.parse( + suite)) + + const failedSuitesCount = suites.map(suite => suite.tests.some(test => test.state == 'failed')) + .filter(failed => failed) + .length + + const totalDuration = new Date(json.end) - new Date(json.start) + + fs.writeFileSync(SUMMARY_FILE_PATH, JSON.stringify(createSummary(platform, totalDuration, suites.length, failedSuitesCount))); +} + +function createSummary(platform, totalDuration, totalNumberOfTests, failedSuitesCount) { + const authorLink = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_ACTOR}`; + const title = `It took ${new Date(totalDuration).getMinutes()}min ${new Date(totalDuration).getSeconds()}s to execute ${totalNumberOfTests} tests. Number of failed tests: ${failedSuitesCount}.`; + const repoUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}`; + + return smb() + .attachment() + .color((failedSuitesCount == 0 && totalNumberOfTests > 0) ? "#36a64f" : "ff0000") + .pretext("Finished BrowserStack tests.") + .authorName(process.env.GITHUB_ACTOR) + .authorLink(authorLink) + .authorIcon(`${authorLink}.png?size=32`) + .title(title) + .field() + .title("Ref") + .value(process.env.GITHUB_REF) + .short(true) + .end() + .field() + .title("Actions URL") + .value( + `<${repoUrl}/actions/runs/${process.env.GITHUB_RUN_ID}|${process.env.GITHUB_WORKFLOW}>` + ) + .short(true) + .end() + .field() + .title("Commit") + .value( + `<${repoUrl}/commit/${process.env.GITHUB_SHA}|${process.env.GITHUB_SHA.slice(0,6)}>` + ) + .short(true) + .end() + .field() + .title("Platform") + .value(platform) + .short(true) + .end() + .end() + .json() +} + From 57c5ec3b1fe55c6e8f127595c241b2d52b8f7c83 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 21 Sep 2023 17:19:32 +0100 Subject: [PATCH 04/20] Merge workflows for simpler browserstack config --- .../workflows/ios-build-and-distribute.yml | 137 +++++++++++++++++- .github/workflows/ios-compat-testing.yml | 127 ---------------- .gitignore | 3 +- compat-testing/test-config/wdio.ios.bs.conf | 29 ++++ 4 files changed, 167 insertions(+), 129 deletions(-) delete mode 100644 .github/workflows/ios-compat-testing.yml create mode 100644 compat-testing/test-config/wdio.ios.bs.conf diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 66a137540..3800abdbd 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -210,4 +210,139 @@ jobs: if: ${{ success() || failure() }} run: | node report-script/github-tests-summary-script.js createGithubSummaryReport - \ No newline at end of file + + + ios-test-rn-version-compatibility: + name: Test react-native version compatibility + needs: build-and-upload-to-appetize + runs-on: macos-latest + strategy: + matrix: + version: ["0.70.8", "0.72.3"] + steps: + - name: Cancel previous jobs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Retrieve Browserstack ID + uses: actions/download-artifact@v3 + with: + name: browserstack_id + path: /var/tmp + + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa_github_actions + known_hosts: unnecessary + + - uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.6" + bundler-cache: true + + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Add slack message builder + run: | + yarn add slack-message-builder + + - name: Get npm cache directory + id: npm-cache-dir + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + + - name: Cache npm dependencies + uses: actions/cache@v3 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json', '*/*/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Set legacy-peer-deps for npm config + run: | + npm config set legacy-peer-deps true + + - name: Create test app + run: | + npx react-native init testapp --version ${{matrix.version}} + + - name: Install Primer SDK + run: | + yarn --cwd testapp add @primer-io/react-native + + - name: CocoaPods Install + run: | + cd testapp/ios ; npx pod-install ; cd .. + + - name: Move Testing Template Files + run: | + cp -r ../compat-testing/* ./ + + - name: Install Appium Packages + run: | + yarn add --dev \ + appium appium-xcuitest-driver \ + appium-uiautomator2-driver \ + mocha-tags \ + @wdio/appium-service \ + @wdio/browserstack-service \ + @wdio/cli \ + @wdio/local-runner \ + @wdio/mocha-framework \ + @wdio/spec-reporter \ + wdio-json-reporter \ + @babel/cli \ + @babel/preset-env \ + @babel/register \ + typescript \ + ts-node + + - name: Run iOS bundler and build + run: | + npx react-native run-ios + + - name: Start Appium Server + run: | + nohup npx appium & + + - name: Run Compatibility Tests + 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 test-config/wdio.ios.bs.conf.js + + - name: Create Slack Report + if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} + run: | + node report-scripts/test-report-script.js createSlackReport iOS + + - name: Post summary message to a Slack channel + if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} + id: slack + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} + payload-file-path: '/var/tmp/slack-minimal_summary.json' + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/ios-compat-testing.yml b/.github/workflows/ios-compat-testing.yml deleted file mode 100644 index e8983f156..000000000 --- a/.github/workflows/ios-compat-testing.yml +++ /dev/null @@ -1,127 +0,0 @@ ---- -name: iOS Compatibility -on: pull_request -jobs: - ios-test-rn-version-compatibility: - name: Test react-native version compatibility - runs-on: macos-latest - strategy: - matrix: - version: ["0.70.8", "0.72.3"] - steps: - - name: Cancel previous jobs - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - - name: Install SSH key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.SSH_KEY }} - name: id_rsa_github_actions - known_hosts: unnecessary - - - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "2.6" - bundler-cache: true - - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Add slack message builder - run: | - yarn add slack-message-builder - - - name: Get npm cache directory - id: npm-cache-dir - run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} - - - name: Cache npm dependencies - uses: actions/cache@v3 - id: npm-cache - with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json', '*/*/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Set legacy-peer-deps for npm config - run: | - npm config set legacy-peer-deps true - - - name: Create test app - run: | - npx react-native init testapp --version ${{matrix.version}} - - - name: Install Primer SDK - run: | - yarn --cwd testapp add @primer-io/react-native - - - name: CocoaPods Install - run: | - cd testapp/ios ; npx pod-install ; cd .. - - - name: Move Testing Template Files - run: | - cp -r ../compat-testing/* ./ - - - name: Install Appium Packages - run: | - yarn add --dev \ - appium appium-xcuitest-driver \ - appium-uiautomator2-driver \ - mocha-tags \ - @wdio/appium-service \ - @wdio/browserstack-service \ - @wdio/cli \ - @wdio/local-runner \ - @wdio/mocha-framework \ - @wdio/spec-reporter \ - wdio-json-reporter \ - @babel/cli \ - @babel/preset-env \ - @babel/register \ - typescript \ - ts-node - - - name: Run iOS bundler and build - run: | - npx react-native run-ios - - - name: Start Appium Server - run: | - nohup npx appium & - - - name: Run Compatibility Tests - run: | - npx wdio test-config/wdio.ios.conf.js - - - name: Create Slack Report - if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} - run: | - node report-scripts/test-report-script.js createSlackReport iOS - - - name: Post summary message to a Slack channel - if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} - id: slack - uses: slackapi/slack-github-action@v1.23.0 - with: - channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} - payload-file-path: '/var/tmp/slack-minimal_summary.json' - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3bcbe9c90..381409701 100644 --- a/.gitignore +++ b/.gitignore @@ -64,4 +64,5 @@ android/keystores/debug.keystore lib/ # npm -.npmrc \ No newline at end of file +.npmrc +testapp/ diff --git a/compat-testing/test-config/wdio.ios.bs.conf b/compat-testing/test-config/wdio.ios.bs.conf new file mode 100644 index 000000000..62af1c777 --- /dev/null +++ b/compat-testing/test-config/wdio.ios.bs.conf @@ -0,0 +1,29 @@ +require("dotenv").config(); +const { config } = require("./wdio.shared.conf"); + +// BROWSERSTACK +config.user = process.env.BROWSERSTACK_USERNAME; +config.key = process.env.BROWSERSTACK_ACCESS_KEY; +config.services = ["browserstack"]; + +// SPECS +config.specs = [ + "./test/specs/*spec.js", + "./test/specs/**/*spec.js", + "../test/specs/*spec.js", + "../test/specs/**/*spec.js", +]; + +// CAPABILITIES +config.capabilities = [ + { + platformName: "IOS", + "appium:platformVersion": "16.2", + "appium:deviceName": "iPhone 14 Plus", + "appium:automationName": "XCUITest", + "appium:app": process.env.BROWSERSTACK_APP_ID, + }, +]; + +exports.config = config; + From f3ea31353e7281933ee25487a8e39a0684ecf238 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 11:32:35 +0100 Subject: [PATCH 05/20] Add browserstack build step to github worfklow --- .../workflows/ios-build-and-distribute.yml | 108 +++++++++++++++++- 1 file changed, 106 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 3800abdbd..37cceb62b 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -153,11 +153,115 @@ jobs: path: /var/tmp/PrimerSDK_Debug_Build.zip if-no-files-found: error + build-and-upload-to-browserstack: + runs-on: macos-latest + timeout-minutes: 30 + name: Build and upload app to Appetize ๐Ÿš€ + steps: + - name: Cancel previous jobs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa_github_actions + known_hosts: unnecessary + + - uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.6" + bundler-cache: true + + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + + - name: Add slack message builder + run: | + yarn add slack-message-builder + + - name: Get npm cache directory + id: npm-cache-dir + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + + - name: Cache npm dependencies + uses: actions/cache@v3 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json', '*/*/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Set legacy-peer-deps for npm config + run: | + npm config set legacy-peer-deps true + + - name: Cache pods + uses: actions/cache@v3 + with: + path: | + ios/Pods + ~/Library/Caches/CocoaPods + ~/.cocoapods + key: ${{ runner.os }}-pods-${{ hashFiles('*/Podfile.lock', '*/*/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + + - name: Install packages + run: | + yarn + + - name: Create main.jsbundle + run: | + yarn --cwd example build:ios + + - name: Distribute the React Native iOS app on Appetize ๐Ÿš€ + run: | + bundle exec fastlane ios qa_release + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }} + SOURCE_BRANCH: ${{ github.head_ref }} + PR_NUMBER: ${{ github.event.pull_request.number }} + + - 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 test-via-browserstack: if: false # Re-enable when we have tests set up runs-on: ubuntu-latest - needs: build-and-upload-to-appetize + needs: build-and-upload-to-browserstack name: Browserstack test steps: - name: Clone and launch Browserstack tests via Appium ๐Ÿงช @@ -214,7 +318,7 @@ jobs: ios-test-rn-version-compatibility: name: Test react-native version compatibility - needs: build-and-upload-to-appetize + needs: build-and-upload-to-browserstack runs-on: macos-latest strategy: matrix: From 3fa77128cfbc4e449b6194ac08cdfc278f29fbe3 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 11:39:03 +0100 Subject: [PATCH 06/20] Use correct naming for browserstack distribution workflow --- .github/workflows/ios-build-and-distribute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 37cceb62b..1a0ad8885 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -156,7 +156,7 @@ jobs: build-and-upload-to-browserstack: runs-on: macos-latest timeout-minutes: 30 - name: Build and upload app to Appetize ๐Ÿš€ + name: Build and upload app to BrowserStack ๐Ÿš€ steps: - name: Cancel previous jobs uses: styfle/cancel-workflow-action@0.11.0 From b6f46abbf0d2b029fa4e351332da82cdaea3c218 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 13:33:14 +0100 Subject: [PATCH 07/20] Tweak building for browserstack in github workflow --- .github/workflows/ios-build-and-distribute.yml | 2 ++ fastlane/IOSFastFile | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 1a0ad8885..1d400cb0b 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -247,6 +247,8 @@ jobs: MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} APPETIZE_API_TOKEN: ${{ secrets.APPETIZE_API_TOKEN }} + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} SOURCE_BRANCH: ${{ github.head_ref }} PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 5ac186757..048e6cb47 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -60,11 +60,11 @@ platform :ios do scheme: app_scheme, workspace: app_workspace, configuration: "Debug", - destination: "generic/platform=iOS Simulator", - xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", + # destination: "generic/platform=iOS Simulator", + # xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", include_bitcode: false, export_method: "development", - skip_package_dependencies_resolution: true, + skip_package_dependencies_resolution: true ) # Upload to Browserstack From 83e0203b803dac462aea282c9442b0abfbd017f9 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 14:33:07 +0100 Subject: [PATCH 08/20] Update iOS Appfile --- fastlane/Appfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fastlane/Appfile b/fastlane/Appfile index 84125c51c..a24d0f628 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,2 +1,5 @@ -json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one -package_name("com.primerapi.example.rn") +#json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one +#package_name("com.primerapi.example.rn") +app_identifier("com.primerapi.example.rn") # The bundle identifier of your app +apple_id("security@primerapi.com") # Your Apple email address +team_id "N8UN9TR5DY" # Developer Portal Team ID \ No newline at end of file From 083ed9763e1cb97fd257fbec6428ad7f429a431e Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 14:44:36 +0100 Subject: [PATCH 09/20] Update matchfile --- fastlane/Matchfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 758455392..660de017a 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -5,7 +5,7 @@ storage_mode("git") type("development") # The default type, can be: appstore, adhoc, enterprise or development app_identifier("com.primerapi.example.rn") -username("sdk@primer.io") # Your Apple Developer Portal username +username("security@primerapi.com") # Your Apple Developer Portal username platform("ios") shallow_clone true From 1921655a459ff23fe77ec21e78af4866e2b6e8e6 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 14:46:51 +0100 Subject: [PATCH 10/20] Add pod install to qa_release lane --- fastlane/IOSFastFile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 048e6cb47..b6df60c79 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -13,6 +13,7 @@ github_run_number = ENV["GITHUB_RUN_NUMBER"] app_workspace = "example/ios/example_0_70_6.xcworkspace" app_xcode_proj = "example/ios/example_0_70_6.xcodeproj" app_scheme = "example_0_70_6" +podfile_path = "example/ios/Podfile" # Packages app_output_path = "/var/tmp/Primer.io_ReactNativeExample.xcarchive/Products/Applications/example_0_70_6.app" @@ -55,6 +56,12 @@ platform :ios do common_pre_build_action + cocoapods( + clean_install: true, + use_bundle_exec: true, + podfile: podfile_path + ) + # Build for browserstack build_app( scheme: app_scheme, From 368edbe9439a420cf8934647e0e792066411b850 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 15:01:40 +0100 Subject: [PATCH 11/20] Add cocoapods to root Gemfile --- Gemfile | 1 + Gemfile.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/Gemfile b/Gemfile index b3c103d6c..2f0dcb971 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ source "https://rubygems.org" ruby ">= 2.6.10" gem "fastlane" +gem "cocoapods" plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'PluginFile') eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index 77bbc3330..2cacddb49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,8 +3,16 @@ GEM specs: CFPropertyList (3.0.6) rexml + activesupport (5.2.8.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) @@ -25,10 +33,48 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) + cocoapods (1.10.2) + addressable (~> 2.6) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.10.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.2) + activesupport (> 5.0, < 6) + addressable (~> 2.6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.6.3) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) + concurrent-ruby (1.2.2) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -36,6 +82,9 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) excon (0.99.0) faraday (1.10.3) faraday-em_http (~> 1.0) @@ -108,6 +157,9 @@ GEM fastlane-plugin-browserstack (0.3.2) rest-client (~> 2.0, >= 2.0.2) fastlane-plugin-firebase_app_distribution (0.4.2) + ffi (1.15.5) + fourflusher (2.3.1) + fuzzy_match (2.0.4) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.33.0) google-apis-core (>= 0.9.1, < 2.a) @@ -152,6 +204,8 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) + i18n (1.14.1) + concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.6.3) jwt (2.7.0) @@ -161,9 +215,12 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.12.0) mini_mime (1.1.2) + minitest (5.20.0) + molinillo (0.6.6) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) + nap (1.1.0) naturally (2.2.1) netrc (0.11.0) optparse (0.1.1) @@ -183,6 +240,7 @@ GEM retriable (3.1.2) rexml (3.2.5) rouge (2.0.7) + ruby-macho (1.4.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) @@ -197,11 +255,16 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.11) + thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) unf_ext @@ -229,6 +292,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + cocoapods fastlane fastlane-plugin-browserstack fastlane-plugin-firebase_app_distribution From 4a4829b8091d04ee876ce2556964201ea76e7336 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 15:19:43 +0100 Subject: [PATCH 12/20] Save build log on error + correct account in Matchfile --- .github/workflows/ios-build-and-distribute.yml | 8 ++++++++ fastlane/Matchfile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 1d400cb0b..ba949550f 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -251,6 +251,14 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} SOURCE_BRANCH: ${{ github.head_ref }} PR_NUMBER: ${{ github.event.pull_request.number }} + + - name: Save build log + uses: actions/upload-artifact@v3 + id: fastlane_build_log + if: ${{ failure() }} + with: + name: fastlane_build.log + path: /Users/runner/Library/Logs/gym/example_0_70_6-example_0_70_6.log - name: Save Browserstack ID uses: actions/upload-artifact@v3 diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 660de017a..758455392 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -5,7 +5,7 @@ storage_mode("git") type("development") # The default type, can be: appstore, adhoc, enterprise or development app_identifier("com.primerapi.example.rn") -username("security@primerapi.com") # Your Apple Developer Portal username +username("sdk@primer.io") # Your Apple Developer Portal username platform("ios") shallow_clone true From f0068072d44071e929293f788c2b9dcf0282fd07 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 15:42:16 +0100 Subject: [PATCH 13/20] Remove duplicated MatchFile grrrrrrrrr --- fastlane/MatchFile | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 fastlane/MatchFile diff --git a/fastlane/MatchFile b/fastlane/MatchFile deleted file mode 100644 index 758455392..000000000 --- a/fastlane/MatchFile +++ /dev/null @@ -1,18 +0,0 @@ -git_url("git@github.com:primer-io/ios_sdk_match_repo.git") - -storage_mode("git") - -type("development") # The default type, can be: appstore, adhoc, enterprise or development - -app_identifier("com.primerapi.example.rn") -username("sdk@primer.io") # Your Apple Developer Portal username - -platform("ios") -shallow_clone true -force_for_new_devices true -clone_branch_directly true - -# For all available options run `fastlane match --help` -# Remove the # in the beginning of the line to enable the other options - -# The docs are available on https://docs.fastlane.tools/actions/match From fd3940bb74df603e8acc7bc1cfa475d9a9adeea4 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Fri, 22 Sep 2023 15:43:34 +0100 Subject: [PATCH 14/20] Update CORRECT Matchfile --- fastlane/Matchfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 758455392..660de017a 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -5,7 +5,7 @@ storage_mode("git") type("development") # The default type, can be: appstore, adhoc, enterprise or development app_identifier("com.primerapi.example.rn") -username("sdk@primer.io") # Your Apple Developer Portal username +username("security@primerapi.com") # Your Apple Developer Portal username platform("ios") shallow_clone true From d2b75d8dba806caa283f6858600be50bffd31f9b Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Mon, 25 Sep 2023 14:55:48 +0100 Subject: [PATCH 15/20] Hard-code provisioning profile and code sign identity for automated build --- example/ios/example_0_70_6.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/example/ios/example_0_70_6.xcodeproj/project.pbxproj index 6ee94723f..53659adbd 100644 --- a/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -492,6 +492,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = example_0_70_6/example_0_70_6.entitlements; + CODE_SIGN_IDENTITY = "Apple Development: MOHAMMED TARIK ALADIN TALEB (P3K69N82DT)"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = N8UN9TR5DY; ENABLE_BITCODE = NO; @@ -508,6 +510,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; + PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.PrimerSDKExample"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -521,6 +524,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = example_0_70_6/example_0_70_6.entitlements; + CODE_SIGN_IDENTITY = "Apple Development: MOHAMMED TARIK ALADIN TALEB (P3K69N82DT)"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = N8UN9TR5DY; INFOPLIST_FILE = example_0_70_6/Info.plist; @@ -536,6 +541,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; + PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.PrimerSDKExample"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; From 1285d424934a7b02e4f1890c2dc64506043898de Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Mon, 25 Sep 2023 15:49:13 +0100 Subject: [PATCH 16/20] Correct app ID for profile specifier --- example/ios/example_0_70_6.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/example/ios/example_0_70_6.xcodeproj/project.pbxproj index 53659adbd..06bc7a343 100644 --- a/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -510,7 +510,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; - PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.PrimerSDKExample"; + PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.example.rn"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -541,7 +541,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; - PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.PrimerSDKExample"; + PROVISIONING_PROFILE_SPECIFIER = "match Development com.primerapi.example.rn"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; From 44d6cbc60b15f58fe48b7adcfcce1dc74e91f1e3 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Mon, 25 Sep 2023 16:41:29 +0100 Subject: [PATCH 17/20] Update working dir for running compat tests --- .github/workflows/ios-build-and-distribute.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index ba949550f..83686d79e 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -409,9 +409,10 @@ jobs: - name: Move Testing Template Files run: | - cp -r ../compat-testing/* ./ + cp -r compat-testing/* testapp/ - name: Install Appium Packages + working-directory: ./testapp run: | yarn add --dev \ appium appium-xcuitest-driver \ @@ -431,14 +432,17 @@ jobs: ts-node - name: Run iOS bundler and build + working-directory: ./testapp run: | npx react-native run-ios - name: Start Appium Server + working-directory: ./testapp run: | nohup npx appium & - name: Run Compatibility Tests + working-directory: ./testapp env: BROWSERSTACK_USERNAME: ${{secrets.BROWSERSTACK_USERNAME}} BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}} From a45fdc3db36bda0ad8c020024b9517613eb0357a Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Mon, 25 Sep 2023 19:42:43 +0100 Subject: [PATCH 18/20] Correct filename for browserstack wdio config file --- .../test-config/{wdio.ios.bs.conf => wdio.ios.bs.conf.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compat-testing/test-config/{wdio.ios.bs.conf => wdio.ios.bs.conf.js} (100%) diff --git a/compat-testing/test-config/wdio.ios.bs.conf b/compat-testing/test-config/wdio.ios.bs.conf.js similarity index 100% rename from compat-testing/test-config/wdio.ios.bs.conf rename to compat-testing/test-config/wdio.ios.bs.conf.js From 9a3349454527720ade8fa4f2675e8c7845af694d Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Tue, 26 Sep 2023 11:51:57 +0100 Subject: [PATCH 19/20] Test locally instead of using browserstack --- .github/workflows/ios-build-and-distribute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-distribute.yml b/.github/workflows/ios-build-and-distribute.yml index 83686d79e..676284719 100644 --- a/.github/workflows/ios-build-and-distribute.yml +++ b/.github/workflows/ios-build-and-distribute.yml @@ -448,7 +448,7 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}} run: | export BROWSERSTACK_APP_ID=$(cat /var/tmp/browserstack_id.txt) - npx wdio test-config/wdio.ios.bs.conf.js + npx wdio test-config/wdio.ios.conf.js - name: Create Slack Report if: ${{ (success() || failure()) && github.event.pull_request.base.ref == 'master' }} From 19d992daf9f4a28370b4eb439020012268de0737 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Tue, 26 Sep 2023 14:20:08 +0100 Subject: [PATCH 20/20] Switch to 16.2 simulator to align with github workflow supported versions --- compat-testing/test-config/wdio.ios.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat-testing/test-config/wdio.ios.conf.js b/compat-testing/test-config/wdio.ios.conf.js index fe45e8d13..8f9de39a5 100644 --- a/compat-testing/test-config/wdio.ios.conf.js +++ b/compat-testing/test-config/wdio.ios.conf.js @@ -16,7 +16,7 @@ config.specs = [ config.capabilities = [ { platformName: "IOS", - "appium:platformVersion": "16.4", + "appium:platformVersion": "16.2", "appium:deviceName": "iPhone 14", "appium:automationName": "XCUITest", "appium:app": "/var/tmp/testapp.xcarchive/Products/Applications/testapp.app"