From 26084e5eeb0eedfb4ab64c8e597bb09802aab299 Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur Date: Mon, 14 Aug 2023 19:29:59 +0530 Subject: [PATCH 1/6] add: maven workflow dispatch --- .github/workflows/sanity-workflow.yml | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/sanity-workflow.yml diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml new file mode 100644 index 0000000..2784e60 --- /dev/null +++ b/.github/workflows/sanity-workflow.yml @@ -0,0 +1,85 @@ +# This job is to test different maven profiles in sdk branch against full commit-id provided +# This workflow targets Appium execution + +name: NodeJS SDK Test workflow on workflow_dispatch + +on: + workflow_dispatch: + inputs: + commit_sha: + description: 'The full commit id to build' + required: true + +jobs: + comment-run: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 3 + matrix: + node: ['14', '16', '18'] + os: [ macos-latest, windows-latest, ubuntu-latest ] + name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.commit_sha }} + - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-in-progress + env: + job_name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'in_progress' + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Install dependencies + run: npm install + + - name: Run sample tests + run: npm run sample-test + + - name: Run local tests + run: npm run sample-local-test + + - if: always() + uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-completed + env: + conclusion: ${{ job.status }} + job_name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'completed', + conclusion: process.env.conclusion + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } From 7cfe81733577d91d5479da1abe9eb03d62696fdb Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur Date: Mon, 14 Aug 2023 19:36:35 +0530 Subject: [PATCH 2/6] chore: cd into android/ios --- .github/workflows/sanity-workflow.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml index 2784e60..21bae6d 100644 --- a/.github/workflows/sanity-workflow.yml +++ b/.github/workflows/sanity-workflow.yml @@ -55,11 +55,25 @@ jobs: - name: Install dependencies run: npm install - - name: Run sample tests - run: npm run sample-test + - name: Run sample android tests + run: | + cd android + npm run sample-test - - name: Run local tests - run: npm run sample-local-test + - name: Run local android tests + run: | + cd android + npm run sample-local-test + + - name: Run sample ios tests + run: | + cd ios + npm run sample-test + + - name: Run local ios tests + run: | + cd ios + npm run sample-local-test - if: always() uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 From 18f4162309d0332e0c39ac2f26be47041b07e41d Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur <38219887+kamal-kaur04@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:41:46 +0530 Subject: [PATCH 3/6] Add maven workflow (#1) --- .github/workflows/sanity-workflow.yml | 99 +++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/sanity-workflow.yml diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml new file mode 100644 index 0000000..21bae6d --- /dev/null +++ b/.github/workflows/sanity-workflow.yml @@ -0,0 +1,99 @@ +# This job is to test different maven profiles in sdk branch against full commit-id provided +# This workflow targets Appium execution + +name: NodeJS SDK Test workflow on workflow_dispatch + +on: + workflow_dispatch: + inputs: + commit_sha: + description: 'The full commit id to build' + required: true + +jobs: + comment-run: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 3 + matrix: + node: ['14', '16', '18'] + os: [ macos-latest, windows-latest, ubuntu-latest ] + name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.commit_sha }} + - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-in-progress + env: + job_name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'in_progress' + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Install dependencies + run: npm install + + - name: Run sample android tests + run: | + cd android + npm run sample-test + + - name: Run local android tests + run: | + cd android + npm run sample-local-test + + - name: Run sample ios tests + run: | + cd ios + npm run sample-test + + - name: Run local ios tests + run: | + cd ios + npm run sample-local-test + + - if: always() + uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-completed + env: + conclusion: ${{ job.status }} + job_name: NodeJS Appium Repo ${{ matrix.node }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'completed', + conclusion: process.env.conclusion + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } From d2abb8afbbc92e2817c6d0cd03b637c02d661f13 Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur Date: Mon, 14 Aug 2023 19:45:26 +0530 Subject: [PATCH 4/6] chore: cd into android/ios and npm install --- .github/workflows/sanity-workflow.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml index 21bae6d..f444053 100644 --- a/.github/workflows/sanity-workflow.yml +++ b/.github/workflows/sanity-workflow.yml @@ -52,27 +52,28 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Install dependencies - run: npm install - - name: Run sample android tests run: | cd android + npm install npm run sample-test - name: Run local android tests run: | cd android + npm install npm run sample-local-test - name: Run sample ios tests run: | cd ios + npm install npm run sample-test - name: Run local ios tests run: | cd ios + npm install npm run sample-local-test - if: always() From a30727adb602e32d7c852579adb026cd4baa0126 Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur <38219887+kamal-kaur04@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:48:51 +0530 Subject: [PATCH 5/6] Add maven workflow (#2) * add: maven workflow dispatch * chore: cd into android/ios * chore: cd into android/ios and npm install --- .github/workflows/sanity-workflow.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml index 21bae6d..f444053 100644 --- a/.github/workflows/sanity-workflow.yml +++ b/.github/workflows/sanity-workflow.yml @@ -52,27 +52,28 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Install dependencies - run: npm install - - name: Run sample android tests run: | cd android + npm install npm run sample-test - name: Run local android tests run: | cd android + npm install npm run sample-local-test - name: Run sample ios tests run: | cd ios + npm install npm run sample-test - name: Run local ios tests run: | cd ios + npm install npm run sample-local-test - if: always() From 04c1a31e51b43d8d5d049c35a3c7879d127f0204 Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur Date: Mon, 14 Aug 2023 20:02:08 +0530 Subject: [PATCH 6/6] update: localSample.app cli arg --- .github/workflows/sanity-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-workflow.yml b/.github/workflows/sanity-workflow.yml index f444053..581b924 100644 --- a/.github/workflows/sanity-workflow.yml +++ b/.github/workflows/sanity-workflow.yml @@ -62,7 +62,7 @@ jobs: run: | cd android npm install - npm run sample-local-test + npm run sample-local-test -- --browserstack.app "./LocalSample.apk" - name: Run sample ios tests run: | @@ -74,7 +74,7 @@ jobs: run: | cd ios npm install - npm run sample-local-test + npm run sample-local-test -- --browserstack.app "./LocalSample.ipa" - if: always() uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975