Skip to content

Commit

Permalink
Fix tests (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand authored Jul 5, 2024
1 parent 7818712 commit d3b46e6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/android_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
cancel-in-progress: true

env:
ndk_version: 26.1.10909125
ndk_version: 26.3.11579264

jobs:
build:
Expand Down Expand Up @@ -52,7 +52,6 @@ jobs:
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan login
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}

- name: conan profile
run: conan profile detect

Expand All @@ -77,39 +76,33 @@ jobs:
if-no-files-found: error

test:
runs-on: macos-14
runs-on: ubuntu-22.04
strategy:
fail-fast: false
# Make sure the matrix here and in cache_AVD_images.yml is the same
matrix:
include:
# Oldest x86_64
- arch: x86_64
api-level: 23
- arch: x86_64
api-level: 29
# API-30+ tests are failing because play services init something something
- arch: x86
api-level: 30
# API-32+ tests are failing because storage permissions something something
- arch: x86_64
api-level: 32
- { arch: x86_64, api-level: 23 }
- { arch: x86_64, api-level: 29 }
- { arch: x86_64, api-level: 30 }
- { arch: x86_64, api-level: 32 }
steps:
- name: checkout
uses: actions/checkout@v4

- name: install ninja
run: sudo apt-get install -y ninja-build

- name: java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: install brew
run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
- name: install ninja
run: brew install ninja
- name: install bundler
run: gem install bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: install fastlane
run: bundle install

Expand All @@ -120,11 +113,13 @@ jobs:
- name: install python dependencies
run: pip install conan

- name: install ndk
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.ndk_version }}"

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan login
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}

- name: conan profile
run: conan profile detect

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

- 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: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
Expand Down
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ plugins {
id 'com.google.firebase.crashlytics'
}

android {
ndkVersion "26.3.11579264"
}

task conanProfile {
file("build").mkdirs()

Expand Down Expand Up @@ -36,13 +40,11 @@ task conanInstall {
}

android {
compileSdkVersion 34
ndkVersion "26.1.10909125"

defaultConfig {
applicationId "at.tomtasche.reader"
minSdkVersion 23
targetSdkVersion 33
compileSdkVersion 34

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

0 comments on commit d3b46e6

Please sign in to comment.