Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fd3c582

Browse files
authoredAug 17, 2023
Merge pull request #29 from kamal-kaur04/master
Add sanity workflow ~ SDK
2 parents 1e328a9 + 8233f84 commit fd3c582

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed
 

‎.github/workflows/sanity-workflow.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# This job is to test different maven profiles in sdk branch against full commit-id provided
2+
# This workflow targets Java with Maven execution
3+
4+
name: Java SDK Test workflow for Maven on workflow_dispatch
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
commit_sha:
10+
description: 'The full commit id to build'
11+
required: true
12+
13+
jobs:
14+
comment-run:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
max-parallel: 3
19+
matrix:
20+
java: [ '8', '11', '17' ]
21+
os: [ 'macos-latest', 'windows-latest', 'ubuntu-latest' ]
22+
name: JUnit Appium Repo ${{ matrix.Java }} - ${{ matrix.os }} Sample
23+
env:
24+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
25+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
ref: ${{ github.event.inputs.commit_sha }}
31+
- uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
32+
id: status-check-in-progress
33+
env:
34+
job_name: JUnit Appium Repo ${{ matrix.Java }} - ${{ matrix.os }} Sample
35+
commit_sha: ${{ github.event.inputs.commit_sha }}
36+
with:
37+
github-token: ${{ github.token }}
38+
script: |
39+
const result = await github.rest.checks.create({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
name: process.env.job_name,
43+
head_sha: process.env.commit_sha,
44+
status: 'in_progress'
45+
}).catch((err) => ({status: err.status, response: err.response}));
46+
console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`)
47+
if (result.status !== 201) {
48+
console.log('Failed to create check run')
49+
}
50+
- name: Set up Java
51+
uses: actions/setup-java@v3
52+
with:
53+
distribution: 'temurin'
54+
java-version: ${{ matrix.java }}
55+
- name: Run mvn test for junit4 android
56+
run: |
57+
cd junit-4/android
58+
mvn compile
59+
mvn test -P sample-test
60+
- name: Run mvn profile sample-local-test for junit4 android
61+
run: |
62+
cd junit-4/android
63+
mvn compile
64+
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.apk"
65+
- name: Run mvn test for junit4 ios
66+
run: |
67+
cd junit-4/ios
68+
mvn compile
69+
mvn test -P sample-test
70+
- name: Run mvn profile sample-local-test for junit4 ios
71+
run: |
72+
cd junit-4/ios
73+
mvn compile
74+
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.ipa"
75+
- name: Run mvn test for junit5 android
76+
run: |
77+
cd junit-5/android
78+
mvn compile
79+
mvn test -P sample-test
80+
- name: Run mvn profile sample-local-test for junit5 android
81+
run: |
82+
cd junit-5/android
83+
mvn compile
84+
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.apk"
85+
- name: Run mvn test for junit5 ios
86+
run: |
87+
cd junit-5/ios
88+
mvn compile
89+
mvn test -P sample-test
90+
- name: Run mvn profile sample-local-test for junit5 ios
91+
run: |
92+
cd junit-5/ios
93+
mvn compile
94+
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.ipa"
95+
- if: always()
96+
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
97+
id: status-check-completed
98+
env:
99+
conclusion: ${{ job.status }}
100+
job_name: JUnit Appium Repo ${{ matrix.Java }} - ${{ matrix.os }} Sample
101+
commit_sha: ${{ github.event.inputs.commit_sha }}
102+
with:
103+
github-token: ${{ github.token }}
104+
script: |
105+
const result = await github.rest.checks.create({
106+
owner: context.repo.owner,
107+
repo: context.repo.repo,
108+
name: process.env.job_name,
109+
head_sha: process.env.commit_sha,
110+
status: 'completed',
111+
conclusion: process.env.conclusion
112+
}).catch((err) => ({status: err.status, response: err.response}));
113+
console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`)
114+
if (result.status !== 201) {
115+
console.log('Failed to create check run')
116+
}

0 commit comments

Comments
 (0)
Please sign in to comment.