Skip to content

Add sanity workflow ~ SDK #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/maven-workflow-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# This job is to test different maven profiles in sdk branch against full commit-id provided
# This workflow targets Java with Maven execution

name: Java SDK Test workflow for Maven 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:
java: [ '8', '11', '17' ]
os: [ 'macos-latest', 'windows-latest', 'ubuntu-latest' ]
name: TestNG Appium Repo ${{ matrix.Java }} - ${{ 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: TestNG Appium Repo ${{ matrix.Java }} - ${{ 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: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Run mvn test for testng android
run: |
cd android/testng-examples
mvn compile
mvn test
- name: Run mvn profile sample-test for testng android
run: |
cd android/testng-examples
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for testng android
run: |
cd android/testng-examples
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.apk"
- name: Run mvn test for testng ios
run: |
cd ios/testng-examples
mvn compile
mvn test
- name: Run mvn profile sample-test for testng ios
run: |
cd ios/testng-examples
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for testng ios
run: |
cd ios/testng-examples
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.ipa"
- if: always()
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
id: status-check-completed
env:
conclusion: ${{ job.status }}
job_name: TestNG Appium Repo ${{ matrix.Java }} - ${{ 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')
}