Skip to content

Commit d3b46e6

Browse files
authored
Fix tests (#358)
1 parent 7818712 commit d3b46e6

2 files changed

Lines changed: 29 additions & 26 deletions

File tree

.github/workflows/android_main.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
env:
23-
ndk_version: 26.1.10909125
23+
ndk_version: 26.3.11579264
2424

2525
jobs:
2626
build:
@@ -52,7 +52,6 @@ jobs:
5252
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
5353
- name: conan login
5454
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
55-
5655
- name: conan profile
5756
run: conan profile detect
5857

@@ -77,39 +76,33 @@ jobs:
7776
if-no-files-found: error
7877

7978
test:
80-
runs-on: macos-14
79+
runs-on: ubuntu-22.04
8180
strategy:
8281
fail-fast: false
83-
# Make sure the matrix here and in cache_AVD_images.yml is the same
8482
matrix:
8583
include:
86-
# Oldest x86_64
87-
- arch: x86_64
88-
api-level: 23
89-
- arch: x86_64
90-
api-level: 29
91-
# API-30+ tests are failing because play services init something something
92-
- arch: x86
93-
api-level: 30
94-
# API-32+ tests are failing because storage permissions something something
95-
- arch: x86_64
96-
api-level: 32
84+
- { arch: x86_64, api-level: 23 }
85+
- { arch: x86_64, api-level: 29 }
86+
- { arch: x86_64, api-level: 30 }
87+
- { arch: x86_64, api-level: 32 }
9788
steps:
9889
- name: checkout
9990
uses: actions/checkout@v4
10091

92+
- name: install ninja
93+
run: sudo apt-get install -y ninja-build
94+
10195
- name: java
10296
uses: actions/setup-java@v4
10397
with:
10498
distribution: 'zulu'
10599
java-version: 17
106100

107-
- name: install brew
108-
run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
109-
- name: install ninja
110-
run: brew install ninja
111-
- name: install bundler
112-
run: gem install bundler
101+
- uses: ruby/setup-ruby@v1
102+
with:
103+
ruby-version: '3.3'
104+
bundler-cache: true
105+
113106
- name: install fastlane
114107
run: bundle install
115108

@@ -120,11 +113,13 @@ jobs:
120113
- name: install python dependencies
121114
run: pip install conan
122115

116+
- name: install ndk
117+
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.ndk_version }}"
118+
123119
- name: conan remote
124120
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
125121
- name: conan login
126122
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
127-
128123
- name: conan profile
129124
run: conan profile detect
130125

@@ -137,6 +132,12 @@ jobs:
137132
~/.android/adb*
138133
key: avd-${{ matrix.arch }}-${{ matrix.api-level }}-r4
139134

135+
- name: Enable KVM group perms
136+
run: |
137+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
138+
sudo udevadm control --reload-rules
139+
sudo udevadm trigger --name-match=kvm
140+
140141
- name: Create AVD and generate snapshot for caching
141142
if: steps.avd-cache.outputs.cache-hit != 'true'
142143
uses: reactivecircus/android-emulator-runner@v2

app/build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ plugins {
44
id 'com.google.firebase.crashlytics'
55
}
66

7+
android {
8+
ndkVersion "26.3.11579264"
9+
}
10+
711
task conanProfile {
812
file("build").mkdirs()
913

@@ -36,13 +40,11 @@ task conanInstall {
3640
}
3741

3842
android {
39-
compileSdkVersion 34
40-
ndkVersion "26.1.10909125"
41-
4243
defaultConfig {
4344
applicationId "at.tomtasche.reader"
4445
minSdkVersion 23
4546
targetSdkVersion 33
47+
compileSdkVersion 34
4648

4749
testApplicationId "at.tomtasche.reader.test"
4850
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -165,4 +167,4 @@ dependencies {
165167
// espresso-idling-resource is used in main sourceSet as well. cannot be just androidTestImplementation
166168
implementation 'androidx.test.espresso:espresso-idling-resource:3.5.1'
167169
implementation 'androidx.annotation:annotation:1.8.0'
168-
}
170+
}

0 commit comments

Comments
 (0)