-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (61 loc) · 2.76 KB
/
android.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
name: Android CI
on:
pull_request:
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
instrumentation-tests:
if: github.event.pull_request.draft == false
runs-on: [ self-hosted, Android ]
strategy:
matrix:
api-level: [ 34 ]
target: [ google_apis ]
env:
ENV_PATH: "app/src/androidTest/java/com/infomaniak/drive/utils/Env.kt"
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
DRIVE_ID: ${{ secrets.DRIVE_ID }}
INVITE_USER_NAME: ${{ secrets.INVITE_USER_NAME }}
NEW_USER_ID: ${{ secrets.NEW_USER_ID }}
NEW_USER_NAME: ${{ secrets.NEW_USER_NAME }}
NEW_USER_PASSWORD: ${{ secrets.NEW_USER_PASSWORD }}
GENIUS_SCAN_ENV_PATH: "app/src/standard/java/com/infomaniak/drive/GeniusScanEnv.kt"
GENIUS_SCAN_KEY: ${{ secrets.GENIUS_SCAN_KEY }}
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout the code
uses: actions/[email protected]
with:
token: ${{ github.token }}
submodules: recursive
- name: Create test env
run: |
touch $ENV_PATH
echo "package com.infomaniak.drive.utils; object Env { const val USE_CURRENT_USER = false; const val TOKEN: String = \"$ACCESS_TOKEN\"; const val DRIVE_ID = $DRIVE_ID; const val INVITE_USER_NAME: String = \"$INVITE_USER_NAME\"; const val NEW_USER_ID = $NEW_USER_ID; const val NEW_USER_NAME: String = \"$NEW_USER_NAME\"; const val NEW_USER_PASSWORD: String = \"$NEW_USER_PASSWORD\" }" > $ENV_PATH
touch $GENIUS_SCAN_ENV_PATH
echo "package com.infomaniak.drive object GeniusScanEnv { const val GENIUS_SCAN_KEY = \"GENIUS_SCAN_KEY\" }" > $GENIUS_SCAN_ENV_PATH
# Setup Gradle and Run tests
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Clean gradle cache
run: ./gradlew clean
- name: Run unit tests
run: ./gradlew testDebugUnitTest --stacktrace
# - name: Run instrumentation tests
# uses: ReactiveCircus/[email protected]
# with:
# api-level: ${{ matrix.api-level }}
# target: ${{ matrix.target }}
# profile: pixel_7
# arch: arm64-v8a
# disk-size: 6G
# avd-name: kdrive-test
# force-avd-creation: false
# disable-animations: true
# emulator-options: -no-snapshot-save -noaudio -no-boot-anim -camera-back none -skin 540x1110
# # emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -skin 540x1110
# script: ./gradlew uninstallAll app:connectedStandardDebugAndroidTest --stacktrace