-
Notifications
You must be signed in to change notification settings - Fork 23
148 lines (144 loc) · 5.5 KB
/
sanity-workflow.yml
File metadata and controls
148 lines (144 loc) · 5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# 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: JUnit 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: JUnit 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 junit4 android
run: |
cd junit-4/android
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for junit4 android
run: |
cd junit-4/android
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.apk"
- name: Run mvn test for junit4 ios
run: |
cd junit-4/ios
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for junit4 ios
run: |
cd junit-4/ios
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.ipa"
- name: Run gradle test for junit4 android
run: |
cd junit-4/android
gradle clean sampleTest
- name: Run gradle sample-local-test for junit4 android
run: |
cd junit-4/android
gradle clean sampleLocalTest -D"browserstack.app"="./LocalSample.apk"
- name: Run gradle test for junit4 ios
run: |
cd junit-4/ios
gradle clean sampleTest
- name: Run gradle sample-local-test for junit4 ios
run: |
cd junit-4/ios
gradle clean sampleLocalTest -D"browserstack.app"="./LocalSample.ipa"
- name: Run mvn test for junit5 android
run: |
cd junit-5/android
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for junit5 android
run: |
cd junit-5/android
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.apk"
- name: Run mvn test for junit5 ios
run: |
cd junit-5/ios
mvn compile
mvn test -P sample-test
- name: Run mvn profile sample-local-test for junit5 ios
run: |
cd junit-5/ios
mvn compile
mvn test -P sample-local-test -D"browserstack.app"="./LocalSample.ipa"
- name: Run gradle test for junit5 android
run: |
cd junit-5/android
gradle clean sampleTest
- name: Run gradle sample-local-test for junit5 android
run: |
cd junit-5/android
gradle clean sampleLocalTest -D"browserstack.app"="./LocalSample.apk"
- name: Run gradle test for junit5 ios
run: |
cd junit-5/ios
gradle clean sampleTest
- name: Run gradle sample-local-test for junit5 ios
run: |
cd junit-5/ios
gradle clean sampleLocalTest -D"browserstack.app"="./LocalSample.ipa"
- if: always()
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
id: status-check-completed
env:
conclusion: ${{ job.status }}
job_name: JUnit 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')
}