-
Notifications
You must be signed in to change notification settings - Fork 9
60 lines (51 loc) · 2.09 KB
/
browserstack-app-tests.yml
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
name: "Pera Android BrowserStack Tests"
on:
workflow_dispatch:
push:
pull_request_target:
types: [ opened, closed, synchronize ]
env:
GITHUB_TOKEN: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
browserstack:
if: >
github.event_name != 'pull_request_target' ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'external contribution'))
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: actions/checkout@v4
- name: "Install JDK 21"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "21"
cache: "gradle"
- name: "Create Prod Debug APK"
run: |
./gradlew app:assembleProdDebug
./gradlew app:assembleProdDebugAndroidTest
- name: "Upload and Run Tests on BrowserStack"
id: browserstack
uses: chrisbanes/[email protected]
with:
browserstackUsername: ${{ secrets.BROWSERSTACK_USERNAME }}
browserstackAccessKey: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
project: Pera-Android
buildTag: ${{ github.sha }}
appFilePath: ${{ github.workspace }}/app/build/outputs/apk/prod/debug/app-prod-debug.apk
testFilePath: ${{ github.workspace }}/app/build/outputs/apk/androidTest/prod/debug/app-prod-debug-androidTest.apk
devices: Samsung Galaxy S22-12.0,Google Pixel 9-15.0
- name: "Write to Json file"
run: |
mkdir ${{ github.workspace }}/app/build/reports/browserstack
touch ${{ github.workspace }}/app/build/reports/browserstack/test-results.json
echo '${{ env.test_result }}' > ${{ github.workspace }}/app/build/reports/browserstack/test-results.json
- name: "Upload Test Results"
uses: actions/upload-artifact@v4
with:
name: browserstack-test-results
path: ${{ github.workspace }}/app/build/reports/browserstack/test-results.json