-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (78 loc) · 2.58 KB
/
browerstack.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
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
name: BrowserStack CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GOPRIVATE: github.com/getlantern
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Pull LFS objects
run: git lfs pull
# Install Flutter
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.10.5"
channel: "stable"
- run: flutter --version
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup protoc
uses: arduino/[email protected]
with:
version: '3.x'
- name: Activate protoc-gen-dart plugin
run: |
echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH
dart pub global activate protoc_plugin
mkdir -p "${HOME}/.pub-cache/bin"
mv "${FLUTTER_ROOT}/.pub-cache/bin/protoc-gen-dart" "${HOME}/.pub-cache/bin"
- name: Build Android-Lib
run: make android-lib ANDROID_ARCH=all
- name: Build APK
env:
CI: "true"
run: |
flutter pub get
make do-android-debug ANDROID_ARCH=all
- name: List files in current directory
run: ls -la
- name: Install jq
run: sudo apt-get install jq
- name: Upload to BrowserStack
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_APP_PATH: "build/app/outputs/flutter-apk/app-prod-debug.apk"
run: |
response=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@$BROWSERSTACK_APP_PATH" \
-F "custom_id=LanternApp")
app_url=$(echo $response | jq -r .app_url)
echo "$app_url"
echo "BROWSERSTACK_APP_ID=$app_url" >> $GITHUB_ENV
- name: Run Tests
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
RUN_ENV: "live"
run: |
cd appium_kotlin
./gradlew test