-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (110 loc) · 5.04 KB
/
watchdog.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
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
name: Run watchdog tests
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
inputs:
JDK_VERSION:
description: The JDK version to use
type: number
default: 11
env:
JDK_VERSION: ${{ inputs.JDK_VERSION || '11' }}
API_LEVEL: 26
jobs:
watchdog-tests:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [ "master", "release" ]
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup cgeo preferences and keystore
uses: ./.github/actions/cgeo-preferences
with:
KEY_STORE: ${{ secrets.KEY_STORE }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_ALIAS_PASSWORD: ${{ secrets.KEY_ALIAS_PASSWORD }}
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
MAPS_API_KEY_MARKET: ${{ secrets.MAPS_API_KEY_MARKET }}
MAPS_API2_KEY: ${{ secrets.MAPS_API2_KEY }}
OCDE_OKAPI_CONSUMER_KEY: ${{ secrets.OCDE_OKAPI_CONSUMER_KEY }}
OCDE_OKAPI_CONSUMER_SECRET: ${{ secrets.OCDE_OKAPI_CONSUMER_SECRET }}
OCPL_OKAPI_CONSUMER_KEY: ${{ secrets.OCPL_OKAPI_CONSUMER_KEY }}
OCPL_OKAPI_CONSUMER_SECRET: ${{ secrets.OCPL_OKAPI_CONSUMER_SECRET }}
OCUS_OKAPI_CONSUMER_KEY: ${{ secrets.OCUS_OKAPI_CONSUMER_KEY }}
OCUS_OKAPI_CONSUMER_SECRET: ${{ secrets.OCUS_OKAPI_CONSUMER_SECRET }}
OCNL_OKAPI_CONSUMER_KEY: ${{ secrets.OCNL_OKAPI_CONSUMER_KEY }}
OCNL_OKAPI_CONSUMER_SECRET: ${{ secrets.OCNL_OKAPI_CONSUMER_SECRET }}
OCRO_OKAPI_CONSUMER_KEY: ${{ secrets.OCRO_OKAPI_CONSUMER_KEY }}
OCRO_OKAPI_CONSUMER_SECRET: ${{ secrets.OCRO_OKAPI_CONSUMER_SECRET }}
OCUK_OKAPI_CONSUMER_KEY: ${{ secrets.OCUK_OKAPI_CONSUMER_KEY }}
OCUK_OKAPI_CONSUMER_SECRET: ${{ secrets.OCUK_OKAPI_CONSUMER_SECRET }}
SU_CONSUMER_KEY: ${{ secrets.SU_CONSUMER_KEY }}
SU_CONSUMER_SECRET: ${{ secrets.SU_CONSUMER_SECRET }}
THUNDERFOREST_API_KEY: ${{ secrets.THUNDERFOREST_API_KEY }}
ALC_CONSUMER_KEY: ${{ secrets.ALC_CONSUMER_KEY }}
PREF_COOKIESTORE: ${{ secrets.PREF_COOKIESTORE }}
PREF_USERNAME: ${{ secrets.PREF_USERNAME }}
PREF_PASSWORD: ${{ secrets.PREF_PASSWORD }}
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: temurin
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/androidci' }}
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run Unit Tests
uses: reactivecircus/android-emulator-runner@v2
env:
# Define BUILD_NUMBER environment variable else the change from commit
# https://github.com/cgeo/cgeo/commit/cfa797e3a48cbd581a31f470703ee15ddb191f49
# prevent us to be recognized as a runner, which lead to appID being suffixed
# by ".developer" thus leading to failure installing the cgeo prefrences
BUILD_NUMBER: ${{ github.run_number }}
with:
api-level: ${{ env.API_LEVEL }}
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
./gradlew main:connectedBasicDebugAndroidTest --no-daemon --continue -Pandroid.testInstrumentationRunnerArguments.class=cgeo.watchdog.WatchdogTest
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/**/*.xml'