Skip to content

Commit

Permalink
Merge pull request #256 from opendocument-app/development
Browse files Browse the repository at this point in the history
v3.19
  • Loading branch information
TomTasche authored Feb 25, 2022
2 parents 8333bae + 5782ed9 commit 5c5463d
Show file tree
Hide file tree
Showing 18 changed files with 501 additions and 447 deletions.
107 changes: 85 additions & 22 deletions .github/workflows/android_main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: OpenDocument-Reader-Android

on: [push]
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/android_main.yml'

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: checkout
Expand All @@ -13,7 +22,7 @@ jobs:
- name: ninja
run: sudo apt-get install -y ninja-build
- name: java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
Expand All @@ -22,26 +31,45 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install python dependencies
run: |
python -m pip install --upgrade pip conan

- name: install pip and conan
run: python -m pip install --upgrade pip conan
- name: conan revisions
run: conan config set general.revisions_enabled=1
- name: conan repo
run: conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan

- name: build
run: ./gradlew clean assembleDebug --scan --stacktrace

test:
runs-on: macos-11

strategy:
fail-fast: false
# Make sure the matrix here and in cache_AVD_images.yml is the same
matrix:
include:
# Oldest version we support
- arch: x86
api-level: 19
# Oldest x86_64
- arch: x86_64
api-level: 21
# API diff between 21 and 30 is too big.
# Need to know if test breaking change was old API or new.
- arch: x86_64
api-level: 25
# Newest x86
- arch: x86
api-level: 30
# Newest in general
- arch: x86_64
api-level: 32
steps:
- name: checkout
uses: actions/checkout@v2

- name: java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
Expand All @@ -67,24 +95,59 @@ jobs:
- name: conan repo
run: conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan

- name: run tests
- name: Android Virtual Device (AVD) cache
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.arch }}-${{ matrix.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: 29
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: google_apis
arch: x86_64
script: |
adb logcat > logcat.txt &
bundle exec fastlane tests
sdcard-path-or-size: 1G
script: echo "Generated AVD snapshot for caching."

- uses: actions/upload-artifact@v2
if: ${{ always() }}
# Temp workaround, until https://github.com/ReactiveCircus/android-emulator-runner/pull/219 is included in a release
- name: Increate storage size for emulator
run: echo "disk.dataPartition.size=8G" >> /Users/runner/.android/avd/test.avd/config.ini

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
name: test-report
path: app/build/reports/androidTests/connected/flavors/*DebugAndroidTest
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: google_apis
sdcard-path-or-size: 1G
script: |
mkdir -p testResults/screenshots
adb logcat > testResults/logcat.txt &
adb shell screencap /data/local/tmp/beforeTests.png
adb pull /data/local/tmp/beforeTests.png testResults/screenshots/
bundle exec fastlane tests || touch sorry_but_tests_are_failing
adb pull /sdcard/Pictures/screenshots testResults/ || true
adb shell screencap /data/local/tmp/afterTests.png
adb pull /data/local/tmp/afterTests.png testResults/screenshots/
mv app/build/reports/androidTests/connected testResults/
mv app/build/outputs/androidTest-results testResults/
test ! -f sorry_but_tests_are_failing
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
if: always()
with:
name: test-log
path: logcat.txt
name: testResults-${{ matrix.api-level }}-${{ matrix.arch }}
path: testResults
if-no-files-found: error
58 changes: 31 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.4)
CFPropertyList (3.0.5)
rexml
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.519.0)
aws-sdk-core (3.121.3)
aws-partitions (1.554.0)
aws-sdk-core (3.126.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.50.0)
aws-sdk-core (~> 3, >= 3.121.2)
aws-sdk-kms (1.54.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.104.0)
aws-sdk-core (~> 3, >= 3.121.2)
aws-sdk-s3 (1.112.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.0.3)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
Expand All @@ -36,17 +36,18 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.3)
excon (0.87.0)
faraday (1.8.0)
excon (0.91.0)
faraday (1.9.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
Expand All @@ -55,14 +56,17 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.5)
fastlane (2.197.0)
fastimage (2.2.6)
fastlane (2.204.3)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -102,9 +106,9 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.12.0)
google-apis-androidpublisher_v3 (0.16.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
google-apis-core (0.4.2)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -113,27 +117,27 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.7.0)
google-apis-iamcredentials_v1 (0.10.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-playcustomapp_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.8.0)
google-apis-storage_v1 (0.11.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.2.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
google-cloud-storage (1.36.1)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.1.0)
googleauth (1.1.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -144,7 +148,7 @@ GEM
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
jmespath (1.6.0)
json (2.6.1)
jwt (2.3.0)
memoist (0.16.2)
Expand All @@ -155,7 +159,7 @@ GEM
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
os (1.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
Expand All @@ -180,7 +184,7 @@ GEM
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
trailblazer-option (0.1.1)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
Expand Down
7 changes: 6 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:29.0.4')
implementation platform('com.google.firebase:firebase-bom:29.1.0')
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-perf'
Expand Down Expand Up @@ -125,7 +125,12 @@ dependencies {

androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
// espresso-idling-resource is used in main sourceSet as well. cannot be just androidTestImplementation
implementation 'androidx.test.espresso:espresso-idling-resource:3.4.0'
implementation 'androidx.annotation:annotation:1.3.0'
}

apply plugin: 'com.google.gms.google-services'
Binary file added app/src/androidTest/assets/dummy.pdf
Binary file not shown.
Binary file added app/src/androidTest/assets/test.odt
Binary file not shown.
Loading

0 comments on commit 5c5463d

Please sign in to comment.