Skip to content

chore(e2e): Enhance documentation #26

chore(e2e): Enhance documentation

chore(e2e): Enhance documentation #26

Workflow file for this run

on: [push]
jobs:
setup_nextcloud:
runs-on: ubuntu-latest
name: Run e2e test
strategy:
fail-fast: false
matrix:
api-level: [ 28 ] #, 24, 25, 26, 27, 28, 29 ]
nextcloud-version: [ 'nextcloud:latest' ] #, 'nextcloud:stable', 'nextcloud:production' ]
services:
nextcloud:
image: ${{ matrix.nextcloud-version }}
env:
SQLITE_DATABASE: db.sqlite
NEXTCLOUD_ADMIN_USER: Test
NEXTCLOUD_ADMIN_PASSWORD: Test
NEXTCLOUD_TRUSTED_DOMAINS: 172.17.0.1
ports:
- 8080:80
options: >-
--health-cmd "curl GET 'http://Test:Test@localhost:80/ocs/v2.php/apps/serverinfo/api/v1/info' -f -H 'OCS-APIRequest: true' || exit 1"
--health-interval 1s
--health-timeout 2s
--health-retries 10
--health-start-period 3s
steps:
- name: Checkout
uses: actions/checkout@v2
# TODO 172.17.0.1 is the hard coded IP address of the docker container. Make this more generic.
- name: Verify Nextcloud being present
run: |
curl -v -X GET 'http://Test:[email protected]:8080/ocs/v2.php/cloud/capabilities?format=json' -H 'OCS-APIRequest: true' | jq
##########################
# AVD CACHING START #
##########################
# - name: Gradle cache
# uses: actions/cache@v2
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
#
# - name: AVD cache
# uses: actions/cache@v2
# id: avd-cache
# with:
# path: |
# ~/.android/avd/*
# ~/.android/adb*
# key: avd-${{ 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: ${{ matrix.api-level }}
# force-avd-creation: false
# sdcard-path-or-size: sdcard
# emulator-options: -gpu swiftshader_indirect -no-window -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# script: echo "Generated AVD snapshot for caching."
##########################
# AVD CACHING END #
##########################
- name: Run e2e tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
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: |
adb shell pm uninstall -k --user 0 com.nextcloud.android.beta || true
wget -q https://download.nextcloud.com/android/dev/latest.apk
adb install latest.apk
adb shell pm grant com.nextcloud.android.beta android.permission.READ_EXTERNAL_STORAGE
adb logcat -c || true
adb logcat -s "E2E" -v color &
adb logcat *:I -v color &
./gradlew :sample:connectedDebugAndroidTest