-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (65 loc) · 2.34 KB
/
integration_test.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
name: Integration Test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
build:
runs-on: ubuntu-latest
env:
iam_role_to_assume: ${{ secrets.ROLE_ARN }}
device_farm_project_arn: ${{ secrets.DEVICE_FARM_PROJECT_ARN }}
device_farm_pool_arn: ${{ secrets.DEVICE_FARM_POOL_ARN }}
device_farm_test_spec_arn: ${{ secrets.DEVICE_FARM_TEST_SPEC_ARN }}
steps:
- uses: actions/checkout@v3
- name: set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'corretto'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Configure AWS Credentials
if: ${{ env.iam_role_to_assume != '' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.iam_role_to_assume }}
aws-region: us-west-2
- name: Build release aar
run: ./gradlew assembleRelease
- name: Build apk
run: |
git clone https://github.com/zhu-xiaowei/shopping-android
cd shopping-android
./gradlew assembleDebug
cd ..
- name: Build device farm test file
run: |
cd integrationtest
virtualenv workspace
cd workspace
source bin/activate
pip install pytest
pip install Appium-Python-Client
mkdir tests
cp ../appium/shopping_test.py tests/
find tests/
py.test --collect-only tests/
find . -name '__pycache__' -type d -exec rm -r {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
pip freeze > requirements.txt
zip -r test_bundle.zip tests/ requirements.txt
cd ..
- name: Execute device farm test
run: |
pip install -r requirements.txt
cd devicefarm
cp ../../shopping-android/app/build/output/apk/debug/app-debug.apk ./
cp ../workspace/test_bundle.zip ./
ls
python -c "from automate_device_farm import upload_and_test_android; upload_and_test_android('app-debug.apk', 'test_bundle.zip', '${{ env.device_farm_project_arn }}', '${{ env.device_farm_test_spec_arn }}', '${{ env.device_farm_pool_arn }}')"