From 9978f6d3229ed864b8def5aedd4ed1b66b44aa73 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 07:19:07 +0200 Subject: [PATCH 01/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/analysis.yml | 65 ----------- .github/workflows/assemble.yml | 32 ------ .github/workflows/autoApproveSync.yml | 40 ------- .github/workflows/check.yml | 38 ------ .github/workflows/codeql.yml | 56 --------- .github/workflows/detectNewJavaFiles.yml | 43 ------- .github/workflows/detectSnaphost.yml | 22 ---- .github/workflows/garm.yml | 108 ++++++++++++++++++ .../workflows/gradle-wrapper-validation.yml | 29 ----- .github/workflows/pr-feedback.yml | 50 -------- .github/workflows/reuse.yml | 22 ---- .github/workflows/scorecard.yml | 47 -------- .github/workflows/stale.yml | 35 ------ 13 files changed, 108 insertions(+), 479 deletions(-) delete mode 100644 .github/workflows/analysis.yml delete mode 100644 .github/workflows/assemble.yml delete mode 100644 .github/workflows/autoApproveSync.yml delete mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/detectNewJavaFiles.yml delete mode 100644 .github/workflows/detectSnaphost.yml create mode 100644 .github/workflows/garm.yml delete mode 100644 .github/workflows/gradle-wrapper-validation.yml delete mode 100644 .github/workflows/pr-feedback.yml delete mode 100644 .github/workflows/reuse.yml delete mode 100644 .github/workflows/scorecard.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml deleted file mode 100644 index 5df2a4e64..000000000 --- a/.github/workflows/analysis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Tobias Kaminsky -# SPDX-FileCopyrightText: 2023 Andy Scherzinger -# SPDX-FileCopyrightText: 2023 Josh Richards -# SPDX-License-Identifier: GPL-3.0-or-later - -name: "Analysis" - -on: - pull_request: - branches: [ "master", "main", "stable-*" ] - push: - branches: [ "master", "main", "stable-*" ] - -permissions: - pull-requests: write - contents: write - -concurrency: - group: analysis-wrapper-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - analysis: - runs-on: ubuntu-24.04 - steps: - - name: Setup variables - id: get-vars - run: | - if [ -z "$GITHUB_HEAD_REF" ]; then - # push - { - echo "branch=$GITHUB_REF_NAME" - echo "pr=$GITHUB_RUN_ID" - echo "repo=${{ github.repository }}" - } >> "$GITHUB_OUTPUT" - else - # pull request - { - echo "branch=$GITHUB_HEAD_REF" - echo "pr=${{ github.event.pull_request.number }}" - echo "repo=${{ github.event.pull_request.head.repo.full_name }}" - } >> "$GITHUB_OUTPUT" - fi - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: ${{ steps.get-vars.outputs.repo }} - ref: ${{ steps.get-vars.outputs.branch }} - - name: Set up JDK 17 - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: "temurin" - java-version: 17 - - name: Install dependencies - run: | - sudo apt install python3-defusedxml - - name: Run analysis wrapper - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - mkdir -p "$HOME/.gradle" - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" - scripts/analysis/analysis-wrapper.sh ${{ steps.get-vars.outputs.branch }} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} "$GITHUB_RUN_NUMBER" ${{ steps.get-vars.outputs.pr }} diff --git a/.github/workflows/assemble.yml b/.github/workflows/assemble.yml deleted file mode 100644 index d87b9f423..000000000 --- a/.github/workflows/assemble.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Andy Scherzinger -# SPDX-FileCopyrightText: 2022 Tobias Kaminsky -# SPDX-FileCopyrightText: 2022 Álvaro Brey -# SPDX-License-Identifier: MIT - -name: Assemble - -on: - pull_request: - branches: [ master, stable-* ] - push: - branches: [ master, stable-* ] - -jobs: - assemble: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up JDK 17 - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: "temurin" - java-version: 17 - - name: Setup JVM options - run: | - mkdir -p "$HOME/.gradle" - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" - - name: Assemble - uses: gradle/gradle-build-action@v3 - with: - arguments: assemble diff --git a/.github/workflows/autoApproveSync.yml b/.github/workflows/autoApproveSync.yml deleted file mode 100644 index 738cf4131..000000000 --- a/.github/workflows/autoApproveSync.yml +++ /dev/null @@ -1,40 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Álvaro Brey -# SPDX-License-Identifier: GPL-3.0-or-later - -name: Auto approve sync -on: - pull_request_target: - branches: - - master - - main - types: - - opened - - reopened - - synchronize - - labeled - -concurrency: - group: sync-approve-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - pull-requests: write - -jobs: - auto-approve: - name: Auto approve sync - runs-on: ubuntu-latest - if: ${{ contains(github.event.pull_request.labels.*.name, 'sync') && github.actor == 'nextcloud-android-bot' }} - steps: - - name: Disabled on forks - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - run: | - echo 'Can not approve PRs from forks' - exit 1 - - - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 0fce37d53..000000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2017 Tobias Kaminsky -# SPDX-License-Identifier: GPL-3.0-or-later -name: Check - -on: - pull_request: - branches: [ master, stable-* ] - push: - branches: [ master, stable-* ] - -jobs: - check: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - task: [ detekt, spotlessKotlinCheck, lint ] - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up JDK 17 - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: "temurin" - java-version: 17 - - name: Setup JVM options - run: | - mkdir -p "$HOME/.gradle" - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" - - name: Check ${{ matrix.task }} - uses: gradle/gradle-build-action@v3 - with: - arguments: ${{ matrix.task }} - - uses: actions/upload-artifact@v4 - if: ${{ always() }} - with: - name: ${{ matrix.task }}-report - path: library/build/reports diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 18325b3d3..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,56 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger -# SPDX-FileCopyrightText: 2022 Tobias Kaminsky -# SPDX-FileCopyrightText: 2022 Álvaro Brey -# SPDX-License-Identifier: GPL-3.0-or-later - -name: "CodeQL" - -on: - push: - branches: [ "master", "main", "stable-*" ] - pull_request: - branches: [ "master", "main" ] - schedule: - - cron: '24 18 * * 3' - -permissions: - contents: read - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-24.04 - permissions: - actions: read - contents: read - security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set Swap Space - uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0 - with: - swap-size-gb: 10 - - name: Initialize CodeQL - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - with: - languages: ${{ matrix.language }} - - name: Set up JDK 17 - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: "temurin" - java-version: 17 - - name: Assemble - run: | - mkdir -p "$HOME/.gradle" - echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" - ./gradlew assembleDebug - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 diff --git a/.github/workflows/detectNewJavaFiles.yml b/.github/workflows/detectNewJavaFiles.yml deleted file mode 100644 index 908e3fd28..000000000 --- a/.github/workflows/detectNewJavaFiles.yml +++ /dev/null @@ -1,43 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Andy Scherzinger -# SPDX-FileCopyrightText: 2022 Tobias Kaminsky -# SPDX-FileCopyrightText: 2022 Álvaro Brey -# SPDX-License-Identifier: GPL-3.0-or-later - -name: "Detect new java files" - -on: - pull_request: - branches: [ master, main, stable-* ] - -permissions: read-all - -concurrency: - group: detect-new-java-files-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - detectNewJavaFiles: - runs-on: ubuntu-latest - steps: - - id: file_changes - uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4 - with: - output: ',' - - name: Detect new java files - run: | - if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then - echo "No new files added" - exit 0 - fi - new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat) - if [ -n "$new_java" ]; then - # shellcheck disable=SC2016 - printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY" - exit 1 - else - echo "No new java files detected" - exit 0 - fi diff --git a/.github/workflows/detectSnaphost.yml b/.github/workflows/detectSnaphost.yml deleted file mode 100644 index d5099f4c0..000000000 --- a/.github/workflows/detectSnaphost.yml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2017 Tobias Kaminsky -# SPDX-License-Identifier: GPL-3.0-or-later -name: "Detect snapshot" - -on: - pull_request: - branches: [ master, stable-* ] - push: - branches: [ master, stable-* ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - detekt: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Detect SNAPSHOT - run: scripts/analysis/detectSNAPSHOT.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml new file mode 100644 index 000000000..e66e42b11 --- /dev/null +++ b/.github/workflows/garm.yml @@ -0,0 +1,108 @@ +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: "Screenshot Test" + +on: + pull_request: + branches: [ master, stable-* ] + +permissions: + contents: read + pull-requests: write + +jobs: + tests: + runs-on: ubuntu-22.04 # our own GARM does not yet support it + services: + server: + image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest + ports: + - 80:80 + strategy: + fail-fast: false + matrix: + scheme: [ Light ] + color: [ blue ] + api-level: [ 27 ] + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: wait and ping server + run: | + while ! curl http://localhost/status.php 2>&1 | grep installed; do + echo "wait…" + sleep 5 + done + + - 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 + + - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: "temurin" + java-version: 17 + + - name: create AVD and generate snapshot for caching + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + arch: x86_64 + sdcard-path-or-size: 100M + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 + script: echo "Generated AVD snapshot for caching." + + - name: Configure gradle daemon + run: | + mkdir -p $HOME/.gradle + echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties + echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties + + - name: Build gplay + run: | + sed -i s#http://server#http://10.0.2.2# gradle.properties + sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt + ./gradlew assembleDebug + ./scripts/wait_for_emulator.sh + + - name: Delete old comments + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ always() }} + run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} + + - name: Run tests + run: | + ./gradlew jacocoTestDebugUnitTestReport + ./gradlew installDebugAndroidTest + ./gradlew createDebugCoverageReport + - name: gplay + env: + SHOT_TEST: "true" + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + arch: x86 + sdcard-path-or-size: 100M + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 + script: scripts/wait_for_emulator.sh && ./gradlew jacocoTestDebugUnitTestReport && ./gradlew installDebugAndroidTest && ./gradlew createDebugCoverageReport./gradlew combinedTestReport + + - name: upload failing results + if: ${{ failure() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} + - name: Archive Espresso results + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + if: ${{ always() }} + with: + name: Report-${{ matrix.color }}-${{ matrix.scheme }} + path: app/build/reports + retention-days: 4 diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index 7071005c2..000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,29 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Andy Scherzinger -# SPDX-FileCopyrightText: 2023 Tobias Kaminsky -# SPDX-FileCopyrightText: 2023 Álvaro Brey -# SPDX-License-Identifier: GPL-3.0-or-later - -name: "Validate Gradle Wrapper" -on: - pull_request: - branches: [ master, stable-* ] - push: - branches: [ master, stable-* ] - -# Declare default permissions as read only. -permissions: read-all - -concurrency: - group: validate-gradle-wrapper-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3.5.0 diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml deleted file mode 100644 index 6a01fa09b..000000000 --- a/.github/workflows/pr-feedback.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Marcel Klehr -# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com> -# SPDX-FileCopyrightText: 2023 Daniel Kesselberg -# SPDX-FileCopyrightText: 2023 Florian Steffens -# SPDX-License-Identifier: MIT - -name: 'Ask for feedback on PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - pr-feedback: - runs-on: ubuntu-latest - steps: - - name: The get-github-handles-from-website action - uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0 - id: scrape - with: - website: 'https://nextcloud.com/team/' - - - name: Get blocklist - id: blocklist - run: | - blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) - echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" - - - uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 - with: - feedback-message: | - Hello there, - Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. - - We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. - - Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 - - Thank you for contributing to Nextcloud and we hope to hear from you soon! - - (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) - days-before-feedback: 14 - start-date: '2024-04-30' - exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' - exempt-bots: true diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml deleted file mode 100644 index 8b9b6227e..000000000 --- a/.github/workflows/reuse.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: CC0-1.0 - -name: REUSE Compliance Check - -on: [pull_request] - -jobs: - reuse-compliance-check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: REUSE Compliance Check - uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml deleted file mode 100644 index 1c2939209..000000000 --- a/.github/workflows/scorecard.yml +++ /dev/null @@ -1,47 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Andy Scherzinger -# SPDX-License-Identifier: GPL-3.0-or-later - -name: Scorecard supply-chain security -on: - branch_protection_rule: - schedule: - - cron: '32 23 * * 4' - push: - branches: [ "main", "master" ] - -# Declare default permissions as read only. -permissions: read-all - -concurrency: - group: scorecard-supply-chain-security-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - - steps: - - name: "Checkout code" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 - with: - results_file: results.sarif - results_format: sarif - publish_results: false - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - with: - sarif_file: results.sarif diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 16ffacdb0..000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,35 +0,0 @@ -# synced from @nextcloud/android-config - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Tobias Kaminsky -# SPDX-FileCopyrightText: 2022 Álvaro Brey -# SPDX-License-Identifier: GPL-3.0-or-later - -name: 'Close stale issues' -on: - schedule: - - cron: '0 0 * * *' - -# Declare default permissions as read only. -permissions: read-all - -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 - with: - days-before-stale: 28 - days-before-close: 14 - days-before-pr-close: -1 - only-labels: 'bug,needs info' - exempt-issue-labels: 'no-stale' - stale-issue-message: >- - This bug report did not receive an update in the last 4 weeks. - Please take a look again and update the issue with new details, - otherwise the issue will be automatically closed in 2 weeks. Thank you! - exempt-all-pr-milestones: true - labels-to-remove-when-unstale: 'needs info' From 06941cbe0fa3fbe00965fda5c2d78845fde6ca8b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 07:22:13 +0200 Subject: [PATCH 02/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index e66e42b11..0b8ca2d8c 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -51,7 +51,7 @@ jobs: with: api-level: ${{ matrix.api-level }} force-avd-creation: false - arch: x86_64 + arch: x86 sdcard-path-or-size: 100M target: google_apis emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 From d5db8d4fd140362ab1b29166780098548ef83d83 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 07:33:52 +0200 Subject: [PATCH 03/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 0b8ca2d8c..da7638241 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -68,7 +68,6 @@ jobs: sed -i s#http://server#http://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug - ./scripts/wait_for_emulator.sh - name: Delete old comments env: From 7496034cd432c402b90c58567555308aa421057b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 07:41:28 +0200 Subject: [PATCH 04/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index da7638241..be252f0be 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -69,12 +69,6 @@ jobs: sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug - - name: Delete old comments - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: ${{ always() }} - run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} - - name: Run tests run: | ./gradlew jacocoTestDebugUnitTestReport From 8d2ce5fd717824be7f144c1ef87d36d261058b65 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 07:48:56 +0200 Subject: [PATCH 05/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index be252f0be..2ad2ac998 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -69,11 +69,6 @@ jobs: sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug - - name: Run tests - run: | - ./gradlew jacocoTestDebugUnitTestReport - ./gradlew installDebugAndroidTest - ./gradlew createDebugCoverageReport - name: gplay env: SHOT_TEST: "true" From 275677f3b197b21b8d0590f07ac9d08b03351091 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 08:08:04 +0200 Subject: [PATCH 06/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 2ad2ac998..0d66225bd 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -80,7 +80,7 @@ jobs: sdcard-path-or-size: 100M target: google_apis emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: scripts/wait_for_emulator.sh && ./gradlew jacocoTestDebugUnitTestReport && ./gradlew installDebugAndroidTest && ./gradlew createDebugCoverageReport./gradlew combinedTestReport + script: scripts/wait_for_emulator.sh && ./gradlew jacocoTestDebugUnitTestReport && ./gradlew installDebugAndroidTest && ./gradlew createDebugCoverageReport && ./gradlew combinedTestReport - name: upload failing results if: ${{ failure() }} From 7c12286569ac6a5ef0b67381196567dbcc0f4460 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 08:17:40 +0200 Subject: [PATCH 07/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 0d66225bd..1131a1356 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -65,7 +65,7 @@ jobs: - name: Build gplay run: | - sed -i s#http://server#http://10.0.2.2# gradle.properties + sed -i s#https://server#https://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug From efdb9a925753a3119682419bcea65b5359a4eaa1 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 Apr 2024 08:39:41 +0200 Subject: [PATCH 08/65] Garm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 1131a1356..0ea20b566 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -65,7 +65,7 @@ jobs: - name: Build gplay run: | - sed -i s#https://server#https://10.0.2.2# gradle.properties + sed -i s#https://server#http://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug From 41da1d67da3a4099e5dd80ca4ce42de39279f42c Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:09:37 +0200 Subject: [PATCH 09/65] config Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 0ea20b566..fad8982df 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -35,6 +35,12 @@ jobs: sleep 5 done + - name: configure server + run: | + docker exec --user www-data server OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 + docker exec --user www-data server git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ + docker exec --user www-data server php /var/www/html/occ app:enable activity + - 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 From f311234f00538595f6aaa3badb5802f407ca81dc Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:10:31 +0200 Subject: [PATCH 10/65] config Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index fad8982df..e53499d4b 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: AGPL-3.0-or-later -name: "Screenshot Test" +name: "Garm" on: pull_request: From 9ca909c3a185233c4733a5d7e392bb8b95315d32 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:12:44 +0200 Subject: [PATCH 11/65] docker ps Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index e53499d4b..d863a3d11 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -37,6 +37,7 @@ jobs: - name: configure server run: | + docker ps docker exec --user www-data server OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 docker exec --user www-data server git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ docker exec --user www-data server php /var/www/html/occ app:enable activity From 43f64135959514ef8469da92523ff99ab096c042 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:16:49 +0200 Subject: [PATCH 12/65] server Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index d863a3d11..e8187972f 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -17,6 +17,7 @@ jobs: services: server: image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest + options: --name server ports: - 80:80 strategy: From 23e8fe0d94af87fcfee2330fe38b0be56bdabf69 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:23:36 +0200 Subject: [PATCH 13/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/configServer.sh | 10 ++++++++++ .github/workflows/garm.yml | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/configServer.sh diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh new file mode 100644 index 000000000..66a3db74d --- /dev/null +++ b/.github/workflows/configServer.sh @@ -0,0 +1,10 @@ +#!bin/sh + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Your Name +# SPDX-License-Identifier: MIT +# + +php /var/www/html/occ list +OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index e8187972f..aa01fe81f 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -38,10 +38,10 @@ jobs: - name: configure server run: | - docker ps - docker exec --user www-data server OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 - docker exec --user www-data server git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ - docker exec --user www-data server php /var/www/html/occ app:enable activity + docker cp .github/workflows/config.sh server:/tmp + docker exec server sh -c "chmod +x /tmp/config.sh" + docker exec server sh -c "chown www-data /tmp/config.sh" + docker exec --user www-data sh -c "/tmp/config.sh" - name: Enable KVM group perms run: | From fe4889ea966c013f9cc41df7c9b8c047b997d75b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:24:17 +0200 Subject: [PATCH 14/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index aa01fe81f..180fdd4e9 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -38,7 +38,7 @@ jobs: - name: configure server run: | - docker cp .github/workflows/config.sh server:/tmp + docker cp .github/workflows/configServer.sh server:/tmp docker exec server sh -c "chmod +x /tmp/config.sh" docker exec server sh -c "chown www-data /tmp/config.sh" docker exec --user www-data sh -c "/tmp/config.sh" From 0a106efd3face97994646bd9b3e83339e92479e7 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:26:17 +0200 Subject: [PATCH 15/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/configServer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index 66a3db74d..af326fe38 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -1,4 +1,4 @@ -#!bin/sh +#!/bin/sh # Nextcloud Android Library # From 2e7ba5bf0945e8d753586a7c87ca29142df188c3 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:28:10 +0200 Subject: [PATCH 16/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 180fdd4e9..0a56c91cb 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -38,10 +38,10 @@ jobs: - name: configure server run: | - docker cp .github/workflows/configServer.sh server:/tmp - docker exec server sh -c "chmod +x /tmp/config.sh" - docker exec server sh -c "chown www-data /tmp/config.sh" - docker exec --user www-data sh -c "/tmp/config.sh" + docker cp .github/workflows/configServer.sh server:/tmp/ + docker exec server sh -c "chmod +x /tmp/configServer.sh" + docker exec server sh -c "chown www-data /tmp/configServer.sh" + docker exec --user www-data sh -c "/tmp/configServer.sh" - name: Enable KVM group perms run: | From 48b38b4a6754a202b1cdb1a52db421d235e91df3 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:39:49 +0200 Subject: [PATCH 17/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 0a56c91cb..938812da4 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -39,8 +39,8 @@ jobs: - name: configure server run: | docker cp .github/workflows/configServer.sh server:/tmp/ - docker exec server sh -c "chmod +x /tmp/configServer.sh" - docker exec server sh -c "chown www-data /tmp/configServer.sh" + docker exec server sh -c chmod +x /tmp/configServer.sh + docker exec server sh -c chown www-data /tmp/configServer.sh docker exec --user www-data sh -c "/tmp/configServer.sh" - name: Enable KVM group perms From e794bfff45329d136ba4f9a2682d7d668a35afb5 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:44:55 +0200 Subject: [PATCH 18/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 938812da4..c4ad4007e 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -40,8 +40,7 @@ jobs: run: | docker cp .github/workflows/configServer.sh server:/tmp/ docker exec server sh -c chmod +x /tmp/configServer.sh - docker exec server sh -c chown www-data /tmp/configServer.sh - docker exec --user www-data sh -c "/tmp/configServer.sh" + docker exec --user www-data server /tmp/configServer.sh - name: Enable KVM group perms run: | From a4abc5ec6c4df17861328e03c5b6c755915766f1 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 5 Apr 2024 14:46:30 +0200 Subject: [PATCH 19/65] script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index c4ad4007e..d0ffb4d5d 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -39,7 +39,7 @@ jobs: - name: configure server run: | docker cp .github/workflows/configServer.sh server:/tmp/ - docker exec server sh -c chmod +x /tmp/configServer.sh + docker exec server chmod +x /tmp/configServer.sh docker exec --user www-data server /tmp/configServer.sh - name: Enable KVM group perms From e34aac3f8d00e359565cec8b10902efed5e989cf Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 19 Apr 2024 14:40:30 +0200 Subject: [PATCH 20/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configNC.sh | 50 +++++++++++++++++++++++++++++++ .github/workflows/configServer.sh | 8 +++-- .github/workflows/garm.yml | 6 +++- 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/configNC.sh diff --git a/.github/workflows/configNC.sh b/.github/workflows/configNC.sh new file mode 100644 index 000000000..0c1126644 --- /dev/null +++ b/.github/workflows/configNC.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Your Name +# SPDX-License-Identifier: MIT +# + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash +source ~/.bashrc; nvm install node + +php /var/www/html/occ log:manage --level warning +OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 +OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2 +OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3 +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test' +php /var/www/html/occ user:setting user2 files quota 1G +php /var/www/html/occ group:add users +php /var/www/html/occ group:adduser users user1 +php /var/www/html/occ group:adduser users user2 +php /var/www/html/occ group:adduser users test +git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ +php /var/www/html/occ app:enable activity +git clone -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/ +php /var/www/html/occ app:enable text +git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ +php /var/www/html/occ app:enable end_to_end_encryption +git clone -b master https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ +php /var/www/html/occ app:enable password_policy +git clone -b master https://github.com/nextcloud/external/ /var/www/html/apps/external/ +cd /var/www/html/apps/external; composer install --no-dev +php /var/www/html/occ app:enable external +php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" +git clone -b main https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ +php /var/www/html/occ app:enable -f files_lock +git clone https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ +php /var/www/html/occ app:enable -f groupfolders +php /var/www/html/occ groupfolders:create groupfolder +php /var/www/html/occ groupfolders:group 1 users +git clone https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ +php /var/www/html/occ app:enable -f notifications +php /var/www/html/occ notification:generate test -d test +git clone https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ +cd /var/www/html/apps/photos; composer install +php /var/www/html/occ app:enable -f photos +git clone https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ +cd /var/www/html/apps/assistant; source ~/.bashrc; make +php /var/www/html/occ app:enable -f assistant +php /var/www/html/occ app:enable -f testing diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index af326fe38..964f3ae8a 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -6,5 +6,9 @@ # SPDX-License-Identifier: MIT # -php /var/www/html/occ list -OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 +apt-get update && apt-get install -y composer +mkdir /var/www/.nvm /var/www/.npm +touch /var/www/.bashrc +chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc + +/usr/local/bin/initnc.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index d0ffb4d5d..d5bc2a607 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -40,7 +40,11 @@ jobs: run: | docker cp .github/workflows/configServer.sh server:/tmp/ docker exec server chmod +x /tmp/configServer.sh - docker exec --user www-data server /tmp/configServer.sh + docker exec server /tmp/configServer.sh + docker cp .github/workflows/configNC.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC.sh + docker exec --user www-data server /tmp/configNC.sh + docker exec server /usr/local/bin/run.sh - name: Enable KVM group perms run: | From 61df5da950419ab46569dd51b47c2a3dd0b92ed7 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 19 Apr 2024 15:11:42 +0200 Subject: [PATCH 21/65] let one test fail Signed-off-by: tobiasKaminsky --- library/src/androidTest/java/com/owncloud/android/FileIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/androidTest/java/com/owncloud/android/FileIT.java b/library/src/androidTest/java/com/owncloud/android/FileIT.java index 2cadacc7c..9d9ca446c 100644 --- a/library/src/androidTest/java/com/owncloud/android/FileIT.java +++ b/library/src/androidTest/java/com/owncloud/android/FileIT.java @@ -43,7 +43,7 @@ public void testCreateFolderSuccess() { assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // verify folder - assertTrue(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); + assertFalse(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); // remove folder assertTrue(new RemoveFileRemoteOperation(path).execute(client).isSuccess()); From fa7e0678cf028a6fc4e187eae147060e1b178586 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 19 Apr 2024 15:46:15 +0200 Subject: [PATCH 22/65] use script Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 9 ++++++--- scripts/runTests.sh | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 scripts/runTests.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index d5bc2a607..0b9e51b22 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -91,13 +91,16 @@ jobs: sdcard-path-or-size: 100M target: google_apis emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: scripts/wait_for_emulator.sh && ./gradlew jacocoTestDebugUnitTestReport && ./gradlew installDebugAndroidTest && ./gradlew createDebugCoverageReport && ./gradlew combinedTestReport + script: scripts/runTests.sh - name: upload failing results if: ${{ failure() }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} + LOG_USERNAME: ${{ secrets.LOG_USERNAME }} + LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} + GIT_USERNAME: ${{ secrets.GIT_USERNAME }} + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} + run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "master" "IT" ${{github.event.number}} "${{ secrets.GIT_USERNAME }}" "${{ secrets.GIT_TOKEN }}" - name: Archive Espresso results uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: ${{ always() }} diff --git a/scripts/runTests.sh b/scripts/runTests.sh new file mode 100755 index 000000000..ebec01013 --- /dev/null +++ b/scripts/runTests.sh @@ -0,0 +1,14 @@ +# +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Tobias Kaminsky +# SPDX-License-Identifier: MIT +# + +scripts/wait_for_emulator.sh +adb logcat -c +adb logcat > logcat.txt & +./gradlew jacocoTestDebugUnitTestReport +./gradlew installDebugAndroidTest +./gradlew createDebugCoverageReport +./gradlew combinedTestReport From cd13f899624b98631b3d5521e8ef4458301d5ad1 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 10:24:15 +0200 Subject: [PATCH 23/65] use stable27 and master Signed-off-by: tobiasKaminsky --- .../{configNC.sh => configNC_master.sh} | 0 .github/workflows/configNC_stable27.sh | 50 +++++++++++++++++++ .github/workflows/configServer.sh | 2 +- .github/workflows/garm.yml | 11 ++-- 4 files changed, 57 insertions(+), 6 deletions(-) rename .github/workflows/{configNC.sh => configNC_master.sh} (100%) create mode 100644 .github/workflows/configNC_stable27.sh diff --git a/.github/workflows/configNC.sh b/.github/workflows/configNC_master.sh similarity index 100% rename from .github/workflows/configNC.sh rename to .github/workflows/configNC_master.sh diff --git a/.github/workflows/configNC_stable27.sh b/.github/workflows/configNC_stable27.sh new file mode 100644 index 000000000..81a54520a --- /dev/null +++ b/.github/workflows/configNC_stable27.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Your Name +# SPDX-License-Identifier: MIT +# + +SERVER_VERSION="stable27" + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash +source ~/.bashrc; nvm install node + +php /var/www/html/occ log:manage --level warning +OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 +OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2 +OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3 +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test' +php /var/www/html/occ user:setting user2 files quota 1G +php /var/www/html/occ group:add users +php /var/www/html/occ group:adduser users user1 +php /var/www/html/occ group:adduser users user2 +php /var/www/html/occ group:adduser users test +git clone -b $SERVER_VERSION https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ +php /var/www/html/occ app:enable activity +git clone -b $SERVER_VERSION https://github.com/nextcloud/text.git /var/www/html/apps/text/ +php /var/www/html/occ app:enable text +git clone -b $SERVER_VERSION https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ +php /var/www/html/occ app:enable end_to_end_encryption +git clone -b $SERVER_VERSION https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ +php /var/www/html/occ app:enable password_policy +php /var/www/html/occ app:enable external +php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" +git clone -b $SERVER_VERSION https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ +php /var/www/html/occ app:enable -f files_lock +git clone -b $SERVER_VERSION https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ +php /var/www/html/occ app:enable -f groupfolders +php /var/www/html/occ groupfolders:create groupfolder +php /var/www/html/occ groupfolders:group 1 users +git clone -b $SERVER_VERSION https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ +php /var/www/html/occ app:enable -f notifications +php /var/www/html/occ notification:generate test -d test +git clone -b $SERVER_VERSION https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ +cd /var/www/html/apps/photos; composer install +php /var/www/html/occ app:enable -f photos +git clone https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ +cd /var/www/html/apps/assistant; git checkout tags/v1.0.2; source ~/.bashrc; make +php /var/www/html/occ app:enable -f assistant +php /var/www/html/occ app:enable -f testing diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index 964f3ae8a..3697c0c81 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -11,4 +11,4 @@ mkdir /var/www/.nvm /var/www/.npm touch /var/www/.bashrc chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc -/usr/local/bin/initnc.sh +BRANCH="$1" /usr/local/bin/initnc.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 0b9e51b22..b4f12e866 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -12,7 +12,7 @@ permissions: pull-requests: write jobs: - tests: + test-master: runs-on: ubuntu-22.04 # our own GARM does not yet support it services: server: @@ -23,6 +23,7 @@ jobs: strategy: fail-fast: false matrix: + server: [ master, stable27 ] scheme: [ Light ] color: [ blue ] api-level: [ 27 ] @@ -40,10 +41,10 @@ jobs: run: | docker cp .github/workflows/configServer.sh server:/tmp/ docker exec server chmod +x /tmp/configServer.sh - docker exec server /tmp/configServer.sh - docker cp .github/workflows/configNC.sh server:/tmp/ - docker exec server chmod +x /tmp/configNC.sh - docker exec --user www-data server /tmp/configNC.sh + docker exec server /tmp/configServer.sh ${{ matrix.server }} + docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh + docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh docker exec server /usr/local/bin/run.sh - name: Enable KVM group perms From 223fb746c44373df098d53c133c8fce4928d51ff Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 10:40:44 +0200 Subject: [PATCH 24/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configServer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index 3697c0c81..91f4563f4 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -11,4 +11,4 @@ mkdir /var/www/.nvm /var/www/.npm touch /var/www/.bashrc chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc -BRANCH="$1" /usr/local/bin/initnc.sh +BRANCH="stable27" /usr/local/bin/initnc.sh From ac763c8c0fcc08bc1e8519490ed9c695d0dc53a8 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 10:51:03 +0200 Subject: [PATCH 25/65] force new install Signed-off-by: tobiasKaminsky --- .github/workflows/configServer.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index 91f4563f4..d74765c26 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -11,4 +11,6 @@ mkdir /var/www/.nvm /var/www/.npm touch /var/www/.bashrc chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc +rm data -rf +rm config/config.php BRANCH="stable27" /usr/local/bin/initnc.sh From d38c47d704764172a3db4fa4151cdc808b03a9ab Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 11:30:23 +0200 Subject: [PATCH 26/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configServer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index d74765c26..f9eef62ae 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -13,4 +13,4 @@ chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc rm data -rf rm config/config.php -BRANCH="stable27" /usr/local/bin/initnc.sh +BRANCH="$1" /usr/local/bin/initnc.sh From bebfe8a26f2759da97f04b340d5e9f4ed0209c5c Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 11:59:31 +0200 Subject: [PATCH 27/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 8 +++----- scripts/runTests.sh | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index b4f12e866..e9459fa0a 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -12,7 +12,7 @@ permissions: pull-requests: write jobs: - test-master: + test: runs-on: ubuntu-22.04 # our own GARM does not yet support it services: server: @@ -24,9 +24,7 @@ jobs: fail-fast: false matrix: server: [ master, stable27 ] - scheme: [ Light ] - color: [ blue ] - api-level: [ 27 ] + api-level: [ 27 ] # 15 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -106,6 +104,6 @@ jobs: uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: ${{ always() }} with: - name: Report-${{ matrix.color }}-${{ matrix.scheme }} + name: Report-${{ matrix.server }}-${{ matrix.api-level }} path: app/build/reports retention-days: 4 diff --git a/scripts/runTests.sh b/scripts/runTests.sh index ebec01013..51d633814 100755 --- a/scripts/runTests.sh +++ b/scripts/runTests.sh @@ -11,4 +11,8 @@ adb logcat > logcat.txt & ./gradlew jacocoTestDebugUnitTestReport ./gradlew installDebugAndroidTest ./gradlew createDebugCoverageReport +stat=$? + ./gradlew combinedTestReport + +exit $stat From a1ecf7d7d2274023ce172c8a165a8406f295daf9 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 12:31:33 +0200 Subject: [PATCH 28/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configNC_master.sh | 16 +++++++++++++++- ...nfigNC_stable27.sh => configNC_stable29.sh} | 18 +++++++++++++++--- .github/workflows/garm.yml | 2 +- scripts/uploadReport.sh | 4 ++-- 4 files changed, 33 insertions(+), 7 deletions(-) rename .github/workflows/{configNC_stable27.sh => configNC_stable29.sh} (93%) diff --git a/.github/workflows/configNC_master.sh b/.github/workflows/configNC_master.sh index 0c1126644..7a9a4fc40 100644 --- a/.github/workflows/configNC_master.sh +++ b/.github/workflows/configNC_master.sh @@ -6,10 +6,13 @@ # SPDX-License-Identifier: MIT # + + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash source ~/.bashrc; nvm install node php /var/www/html/occ log:manage --level warning + OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2 OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3 @@ -20,31 +23,42 @@ php /var/www/html/occ group:add users php /var/www/html/occ group:adduser users user1 php /var/www/html/occ group:adduser users user2 php /var/www/html/occ group:adduser users test + git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ php /var/www/html/occ app:enable activity + git clone -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/ php /var/www/html/occ app:enable text + git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ php /var/www/html/occ app:enable end_to_end_encryption + git clone -b master https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ php /var/www/html/occ app:enable password_policy + git clone -b master https://github.com/nextcloud/external/ /var/www/html/apps/external/ cd /var/www/html/apps/external; composer install --no-dev php /var/www/html/occ app:enable external php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" + git clone -b main https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ php /var/www/html/occ app:enable -f files_lock + git clone https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ php /var/www/html/occ app:enable -f groupfolders php /var/www/html/occ groupfolders:create groupfolder php /var/www/html/occ groupfolders:group 1 users + git clone https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ php /var/www/html/occ app:enable -f notifications php /var/www/html/occ notification:generate test -d test + git clone https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ -cd /var/www/html/apps/photos; composer install +cd /var/www/html/apps/photos; composer install --no-dev php /var/www/html/occ app:enable -f photos + git clone https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ cd /var/www/html/apps/assistant; source ~/.bashrc; make php /var/www/html/occ app:enable -f assistant + php /var/www/html/occ app:enable -f testing diff --git a/.github/workflows/configNC_stable27.sh b/.github/workflows/configNC_stable29.sh similarity index 93% rename from .github/workflows/configNC_stable27.sh rename to .github/workflows/configNC_stable29.sh index 81a54520a..fdfecab09 100644 --- a/.github/workflows/configNC_stable27.sh +++ b/.github/workflows/configNC_stable29.sh @@ -6,12 +6,13 @@ # SPDX-License-Identifier: MIT # -SERVER_VERSION="stable27" +SERVER_VERSION="stable29" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash source ~/.bashrc; nvm install node php /var/www/html/occ log:manage --level warning + OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2 OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3 @@ -22,29 +23,40 @@ php /var/www/html/occ group:add users php /var/www/html/occ group:adduser users user1 php /var/www/html/occ group:adduser users user2 php /var/www/html/occ group:adduser users test + git clone -b $SERVER_VERSION https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ php /var/www/html/occ app:enable activity + git clone -b $SERVER_VERSION https://github.com/nextcloud/text.git /var/www/html/apps/text/ php /var/www/html/occ app:enable text + git clone -b $SERVER_VERSION https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ php /var/www/html/occ app:enable end_to_end_encryption + git clone -b $SERVER_VERSION https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ php /var/www/html/occ app:enable password_policy + php /var/www/html/occ app:enable external php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" + git clone -b $SERVER_VERSION https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ php /var/www/html/occ app:enable -f files_lock + git clone -b $SERVER_VERSION https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ php /var/www/html/occ app:enable -f groupfolders php /var/www/html/occ groupfolders:create groupfolder php /var/www/html/occ groupfolders:group 1 users + git clone -b $SERVER_VERSION https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ php /var/www/html/occ app:enable -f notifications php /var/www/html/occ notification:generate test -d test + git clone -b $SERVER_VERSION https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ -cd /var/www/html/apps/photos; composer install +cd /var/www/html/apps/photos; composer install --no-dev php /var/www/html/occ app:enable -f photos + git clone https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ -cd /var/www/html/apps/assistant; git checkout tags/v1.0.2; source ~/.bashrc; make +cd /var/www/html/apps/assistant; git checkout tags/v1.0.8; source ~/.bashrc; npm run build; composer install --no-dev php /var/www/html/occ app:enable -f assistant + php /var/www/html/occ app:enable -f testing diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index e9459fa0a..b08250f73 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - server: [ master, stable27 ] + server: [ master, stable29 ] api-level: [ 27 ] # 15 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/scripts/uploadReport.sh b/scripts/uploadReport.sh index c9b4a0534..f706f31fe 100755 --- a/scripts/uploadReport.sh +++ b/scripts/uploadReport.sh @@ -19,11 +19,11 @@ URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-library-int # upload logcat log_filename=$ID"_logcat.txt.xz" log_file="${log_filename}" -upload_path="https://nextcloud.kaminsky.me/remote.php/webdav/library-logcat/$log_filename" +upload_path="https://nextcloud.kaminsky.me/remote.php/webdav/android-library-logcat/$log_filename" xz logcat.txt mv logcat.txt.xz "$log_file" curl -u "$USER:$PASS" -X PUT "$upload_path" --upload-file "$log_file" -echo >&2 "Uploaded logcat to https://www.kaminsky.me/nc-dev/library-logcat/$log_filename" +echo >&2 "Uploaded logcat to https://www.kaminsky.me/nc-dev/android-library-logcat/$log_filename" if [ $TYPE = "IT" ]; then cd library/build/reports/androidTests/connected From b9a5e4a1501aae6fb1960098903132e2f7694466 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 12:53:48 +0200 Subject: [PATCH 29/65] wip Signed-off-by: tobiasKaminsky --- library/src/androidTest/java/com/owncloud/android/FileIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/androidTest/java/com/owncloud/android/FileIT.java b/library/src/androidTest/java/com/owncloud/android/FileIT.java index 9d9ca446c..2cadacc7c 100644 --- a/library/src/androidTest/java/com/owncloud/android/FileIT.java +++ b/library/src/androidTest/java/com/owncloud/android/FileIT.java @@ -43,7 +43,7 @@ public void testCreateFolderSuccess() { assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // verify folder - assertFalse(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); + assertTrue(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); // remove folder assertTrue(new RemoveFileRemoteOperation(path).execute(client).isSuccess()); From f3009d8de4518a1b7845ccc1771da6b903b2015f Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 14:42:18 +0200 Subject: [PATCH 30/65] also test with api 15 Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index b08250f73..4ca0eab2e 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: server: [ master, stable29 ] - api-level: [ 27 ] # 15 + api-level: [ 15, 27 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 72a896fe33631d9faf7b0a60351723be2542238e Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 15:33:26 +0200 Subject: [PATCH 31/65] api 16 Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 99 +++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 4ca0eab2e..09b4662fb 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: server: [ master, stable29 ] - api-level: [ 15, 27 ] + api-level: [ 16, 27 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -73,7 +73,102 @@ jobs: echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties - - name: Build gplay + - name: Build gplay # TODO build only once! + run: | + sed -i s#https://server#http://10.0.2.2# gradle.properties + sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt + ./gradlew assembleDebug + + - name: gplay + env: + SHOT_TEST: "true" + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + arch: x86 + sdcard-path-or-size: 100M + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 + script: scripts/runTests.sh + + - name: upload failing results + if: ${{ failure() }} + env: + LOG_USERNAME: ${{ secrets.LOG_USERNAME }} + LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} + GIT_USERNAME: ${{ secrets.GIT_USERNAME }} + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} + run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "master" "IT" ${{github.event.number}} "${{ secrets.GIT_USERNAME }}" "${{ secrets.GIT_TOKEN }}" + - name: Archive Espresso results + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + if: ${{ always() }} + with: + name: Report-${{ matrix.server }}-${{ matrix.api-level }} + path: app/build/reports + retention-days: 4 + + stable16: + runs-on: ubuntu-22.04 # our own GARM does not yet support it + services: + server: + image: nextcloudci/server:server-13 + options: --name server + ports: + - 80:80 + strategy: + fail-fast: false + matrix: + api-level: [ 27 ] + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: wait and ping server + run: | + while ! curl http://localhost/status.php 2>&1 | grep installed; do + echo "wait…" + sleep 5 + done + + - name: configure server + run: | + docker cp .github/workflows/configServer.sh server:/tmp/ + docker exec server chmod +x /tmp/configServer.sh + docker exec server /tmp/configServer.sh ${{ matrix.server }} + docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh + docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh + docker exec server /usr/local/bin/run.sh + + - 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 + + - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: "temurin" + java-version: 17 + + - name: create AVD and generate snapshot for caching + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + arch: x86 + sdcard-path-or-size: 100M + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 + script: echo "Generated AVD snapshot for caching." + + - name: Configure gradle daemon + run: | + mkdir -p $HOME/.gradle + echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties + echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties + + - name: Build gplay # TODO build only once! run: | sed -i s#https://server#http://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt From f378eef65839ad598dfa493376f869e674331f8a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 15:41:00 +0200 Subject: [PATCH 32/65] nc16 Signed-off-by: tobiasKaminsky --- .github/workflows/configNC_stable16.sh | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/configNC_stable16.sh diff --git a/.github/workflows/configNC_stable16.sh b/.github/workflows/configNC_stable16.sh new file mode 100644 index 000000000..a9ef6d8dd --- /dev/null +++ b/.github/workflows/configNC_stable16.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Your Name +# SPDX-License-Identifier: MIT +# + +SERVER_VERSION="stable16" + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash +source ~/.bashrc; nvm install node + +php /var/www/html/occ log:manage --level warning + +OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 +OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2 +OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3 +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test +OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test' +php /var/www/html/occ user:setting user2 files quota 1G +php /var/www/html/occ group:add users +php /var/www/html/occ group:adduser users user1 +php /var/www/html/occ group:adduser users user2 +php /var/www/html/occ group:adduser users test + +php /var/www/html/occ app:enable activity + +php /var/www/html/occ app:enable text + +php /var/www/html/occ app:enable end_to_end_encryption + +php /var/www/html/occ app:enable password_policy + +php /var/www/html/occ app:enable external +php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" + +php /var/www/html/occ app:enable groupfolders +php /var/www/html/occ groupfolders:create groupfolder +php /var/www/html/occ groupfolders:group 1 users + +php /var/www/html/occ app:enable notifications + +php /var/www/html/occ app:enable testing From dc0cfcf3df6ff58674deb2b3d0920439ad3aae35 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 15:44:42 +0200 Subject: [PATCH 33/65] nc16 Signed-off-by: tobiasKaminsky --- .github/workflows/configServer16.sh | 11 +++++++++++ .github/workflows/garm.yml | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/configServer16.sh diff --git a/.github/workflows/configServer16.sh b/.github/workflows/configServer16.sh new file mode 100644 index 000000000..15847e1e7 --- /dev/null +++ b/.github/workflows/configServer16.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Your Name +# SPDX-License-Identifier: MIT +# + +rm data -rf +rm config/config.php +BRANCH="$1" /initnc.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 09b4662fb..a008512d3 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -132,9 +132,9 @@ jobs: - name: configure server run: | - docker cp .github/workflows/configServer.sh server:/tmp/ - docker exec server chmod +x /tmp/configServer.sh - docker exec server /tmp/configServer.sh ${{ matrix.server }} + docker cp .github/workflows/configServer16.sh server:/tmp/ + docker exec server chmod +x /tmp/configServer16.sh + docker exec server /tmp/configServer16.sh ${{ matrix.server }} docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh From 362a530aecbcc4fcccb8350aacd22560efe5d139 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 15:52:12 +0200 Subject: [PATCH 34/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configServer16.sh | 2 +- .github/workflows/garm.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/configServer16.sh b/.github/workflows/configServer16.sh index 15847e1e7..cb603e595 100644 --- a/.github/workflows/configServer16.sh +++ b/.github/workflows/configServer16.sh @@ -8,4 +8,4 @@ rm data -rf rm config/config.php -BRANCH="$1" /initnc.sh +BRANCH="stable16" /initnc.sh diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index a008512d3..b7a4ec1e1 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: server: [ master, stable29 ] - api-level: [ 16, 27 ] + api-level: [ 17, 27 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -134,10 +134,10 @@ jobs: run: | docker cp .github/workflows/configServer16.sh server:/tmp/ docker exec server chmod +x /tmp/configServer16.sh - docker exec server /tmp/configServer16.sh ${{ matrix.server }} - docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ - docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh - docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh + docker exec server /tmp/configServer16.sh + docker cp .github/workflows/configNC_stable16.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC_stable16.sh + docker exec --user www-data server /tmp/configNC_stable16.sh docker exec server /usr/local/bin/run.sh - name: Enable KVM group perms From ec46c8f4031300fe0afa5a3e028fb5752c63ec5c Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 26 Apr 2024 16:02:34 +0200 Subject: [PATCH 35/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configNC_stable16.sh | 4 +--- .github/workflows/garm.yml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/configNC_stable16.sh b/.github/workflows/configNC_stable16.sh index a9ef6d8dd..5760844ef 100644 --- a/.github/workflows/configNC_stable16.sh +++ b/.github/workflows/configNC_stable16.sh @@ -8,9 +8,6 @@ SERVER_VERSION="stable16" -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash -source ~/.bashrc; nvm install node - php /var/www/html/occ log:manage --level warning OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1 @@ -39,6 +36,7 @@ php /var/www/html/occ app:enable groupfolders php /var/www/html/occ groupfolders:create groupfolder php /var/www/html/occ groupfolders:group 1 users +git clone -b $SERVER_VERSION https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ php /var/www/html/occ app:enable notifications php /var/www/html/occ app:enable testing diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index b7a4ec1e1..f4cee21e8 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -138,7 +138,6 @@ jobs: docker cp .github/workflows/configNC_stable16.sh server:/tmp/ docker exec server chmod +x /tmp/configNC_stable16.sh docker exec --user www-data server /tmp/configNC_stable16.sh - docker exec server /usr/local/bin/run.sh - name: Enable KVM group perms run: | From 447ee2f2322ac9a0c599d75788590498c12eae66 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 29 Apr 2024 12:03:28 +0200 Subject: [PATCH 36/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index f4cee21e8..215eeabc8 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: server: [ master, stable29 ] - api-level: [ 17, 27 ] + api-level: [ 18, 27 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 161e328ad0ea8503958a8fd89a8543ec622d9e9b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 29 Apr 2024 12:14:25 +0200 Subject: [PATCH 37/65] wip Signed-off-by: tobiasKaminsky --- ...ectEditingCreateFileRemoteOperationIT.java | 7 ++++ ...btainListOfTemplatesRemoteOperationIT.java | 6 +++ .../DirectEditingObtainRemoteOperationIT.kt | 7 ++++ ...irectEditingOpenFileRemoteOperationIT.java | 7 ++++ .../search/UnifiedSearchRemoteOperationIT.kt | 10 +++++ ...rkspaceDirectEditingRemoteOperationIT.java | 6 +++ .../java/com/owncloud/android/AbstractIT.java | 2 +- .../java/com/owncloud/android/FileIT.java | 9 +++++ .../GetCapabilitiesRemoteOperationIT.java | 22 ++++++----- .../e2ee/UpdateMetadataRemoteOperationIT.java | 2 +- .../files/ReadFileRemoteOperationIT.kt | 4 +- .../files/SearchRemoteOperationIT.java | 39 ++++++++++++++++--- .../files/UploadFileRemoteOperationIT.kt | 33 +++++++++++----- .../shares/GetSharesRemoteOperationIT.java | 3 ++ .../users/AppTokenRemoteOperationIT.kt | 3 ++ 15 files changed, 131 insertions(+), 29 deletions(-) diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java index b8b88a081..81d885844 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java @@ -9,13 +9,20 @@ import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; +import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class DirectEditingCreateFileRemoteOperationIT extends AbstractIT { + @BeforeClass + public static void beforeClass() { + testOnlyOnServer(OwnCloudVersion.nextcloud_18); + } + @Test public void createEmptyFile() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java index 83540cdbe..2ca3334a5 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java @@ -10,7 +10,9 @@ import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.TemplateList; import com.owncloud.android.lib.common.operations.RemoteOperationResult; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; +import org.junit.BeforeClass; import org.junit.Test; import java.util.Objects; @@ -19,6 +21,10 @@ import static org.junit.Assert.assertTrue; public class DirectEditingObtainListOfTemplatesRemoteOperationIT extends AbstractIT { + @BeforeClass + public static void beforeClass() { + testOnlyOnServer(OwnCloudVersion.nextcloud_18); + } @Test public void testGetAll() { diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.kt b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.kt index 4fccbcda2..377384f35 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.kt @@ -8,13 +8,20 @@ package com.nextcloud.android.lib.resources.directediting import com.owncloud.android.AbstractIT +import com.owncloud.android.lib.resources.status.OwnCloudVersion import junit.framework.Assert.assertEquals import junit.framework.Assert.assertFalse import junit.framework.Assert.assertNotNull import junit.framework.Assert.assertTrue +import org.junit.Before import org.junit.Test class DirectEditingObtainRemoteOperationIT : AbstractIT() { + @Before + fun before() { + testOnlyOnServer(OwnCloudVersion.nextcloud_18) + } + @Test fun testGetAll() { val result = DirectEditingObtainRemoteOperation().run(nextcloudClient) diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java index 9f23bf3a7..aa12df605 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java @@ -11,9 +11,11 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation; import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import junit.framework.TestCase; +import org.junit.BeforeClass; import org.junit.Test; import java.io.IOException; @@ -22,6 +24,11 @@ import static org.junit.Assert.assertTrue; public class DirectEditingOpenFileRemoteOperationIT extends AbstractIT { + @BeforeClass + public static void beforeClass() { + testOnlyOnServer(OwnCloudVersion.nextcloud_18); + } + @Test public void openFile() throws IOException { // create file diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/search/UnifiedSearchRemoteOperationIT.kt b/library/src/androidTest/java/com/nextcloud/android/lib/resources/search/UnifiedSearchRemoteOperationIT.kt index 5f78c913c..721cdf00d 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/search/UnifiedSearchRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/search/UnifiedSearchRemoteOperationIT.kt @@ -11,10 +11,12 @@ import com.owncloud.android.AbstractIT import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation import com.owncloud.android.lib.resources.files.model.RemoteFile +import com.owncloud.android.lib.resources.status.OwnCloudVersion import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertNotNull import org.junit.Assert.assertTrue +import org.junit.BeforeClass import org.junit.Test class UnifiedSearchRemoteOperationIT : AbstractIT() { @@ -76,4 +78,12 @@ class UnifiedSearchRemoteOperationIT : AbstractIT() { assertTrue(data.entries.isNotEmpty()) assertNotNull(data.entries.find { it.title == "test Folder" }) } + + companion object { + @BeforeClass + @JvmStatic + fun before() { + testOnlyOnServer(OwnCloudVersion.nextcloud_20) + } + } } diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java b/library/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java index 8d4d2f8c3..eef06c8b5 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java +++ b/library/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java @@ -16,13 +16,19 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation; import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; +import org.junit.BeforeClass; import org.junit.Test; import java.io.File; import java.io.IOException; public class RichWorkspaceDirectEditingRemoteOperationIT extends AbstractIT { + @BeforeClass + public static void beforeClass() { + testOnlyOnServer(OwnCloudVersion.nextcloud_18); + } @Test public void getEditLinkForRoot() { diff --git a/library/src/androidTest/java/com/owncloud/android/AbstractIT.java b/library/src/androidTest/java/com/owncloud/android/AbstractIT.java index 629747cce..9422e2f81 100644 --- a/library/src/androidTest/java/com/owncloud/android/AbstractIT.java +++ b/library/src/androidTest/java/com/owncloud/android/AbstractIT.java @@ -314,7 +314,7 @@ protected void longSleep() { } } - protected void testOnlyOnServer(OwnCloudVersion version) { + static protected void testOnlyOnServer(OwnCloudVersion version) { OCCapability ocCapability = (OCCapability) new GetCapabilitiesRemoteOperation() .execute(nextcloudClient) .getSingleData(); diff --git a/library/src/androidTest/java/com/owncloud/android/FileIT.java b/library/src/androidTest/java/com/owncloud/android/FileIT.java index 2cadacc7c..0caa49fc6 100644 --- a/library/src/androidTest/java/com/owncloud/android/FileIT.java +++ b/library/src/androidTest/java/com/owncloud/android/FileIT.java @@ -25,6 +25,7 @@ import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation; import com.owncloud.android.lib.resources.status.NextcloudVersion; import com.owncloud.android.lib.resources.status.OCCapability; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import org.junit.Test; @@ -146,6 +147,8 @@ public void testShareViaLinkSharees() { @Test public void testShareToGroupSharees() { + testOnlyOnServer(OwnCloudVersion.nextcloud_17); + // create & verify folder String path = "/testFolder/"; assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); @@ -188,6 +191,8 @@ public void testShareToGroupSharees() { @Test public void testOneSharees() { + testOnlyOnServer(OwnCloudVersion.nextcloud_17); + // create & verify folder String path = "/testFolder/"; assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); @@ -223,6 +228,8 @@ public void testOneSharees() { @Test public void testTwoShareesOnParent() { + testOnlyOnServer(OwnCloudVersion.nextcloud_17); + // create & verify folder String path = "/testFolder/"; assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); @@ -271,6 +278,8 @@ public void testTwoShareesOnParent() { @Test public void testTwoSharees() { + testOnlyOnServer(OwnCloudVersion.nextcloud_17); + // create & verify folder String path = "/testFolder/"; assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); diff --git a/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesRemoteOperationIT.java index 5445234be..97533bc45 100644 --- a/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesRemoteOperationIT.java @@ -9,6 +9,13 @@ */ package com.owncloud.android; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.status.CapabilityBooleanType; import com.owncloud.android.lib.resources.status.E2EVersion; @@ -19,13 +26,6 @@ import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - /** * Class to test GetRemoteCapabilitiesOperation */ @@ -112,10 +112,12 @@ private void checkCapability(OCCapability capability, String userId) { assertTrue(capability.getFilesVersioning().isTrue()); assertTrue(capability.getFilesUndelete().isTrue()); assertNotNull(capability.getVersion()); - assertFalse(capability.getEtag().isEmpty()); - assertSame(CapabilityBooleanType.FALSE, capability.getRichDocuments()); - assertFalse(capability.getDirectEditingEtag().isEmpty()); assertSame(CapabilityBooleanType.UNKNOWN, capability.getDropAccount()); + if (capability.getVersion().isNewerOrEqual(OwnCloudVersion.nextcloud_17)) { + assertFalse(capability.getEtag().isEmpty()); + assertFalse(capability.getDirectEditingEtag().isEmpty()); + } + assertSame(CapabilityBooleanType.FALSE, capability.getRichDocuments()); // user status if (capability.getVersion().isNewerOrEqual(OwnCloudVersion.nextcloud_20)) { diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java index c30d7c13e..255bffb8b 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java @@ -26,7 +26,7 @@ public class UpdateMetadataRemoteOperationIT extends AbstractIT { //@Test public void uploadAndModifyV1() { // tests only for NC19+ - testOnlyOnServer(OwnCloudVersion.nextcloud_20); + testOnlyOnServer(OwnCloudVersion.nextcloud_19); // E2E server app checks for official NC client with >=3.13.0, // and blocks all other clients, e.g. 3rd party apps using this lib diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt index 026b4083e..f222981b3 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt @@ -97,6 +97,8 @@ class ReadFileRemoteOperationIT : AbstractIT() { @Test fun testMetadata() { + testOnlyOnServer(NextcloudVersion.nextcloud_27) + val filePath = getFile("gps.jpg").absolutePath val remotePath = "/gps.jpg" @@ -113,8 +115,6 @@ class ReadFileRemoteOperationIT : AbstractIT() { @Suppress("Detekt.MagicNumber") assertEquals(ImageDimension(451f, 529f), remoteFile.imageDimension) - testOnlyOnServer(NextcloudVersion.nextcloud_27) - val ocCapability = GetCapabilitiesRemoteOperation() .execute(nextcloudClient) diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index f16c50e8d..71e77449c 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -24,7 +24,9 @@ import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation; import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation; +import com.owncloud.android.lib.resources.status.NextcloudVersion; import com.owncloud.android.lib.resources.status.OCCapability; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import org.junit.BeforeClass; import org.junit.Test; @@ -94,6 +96,12 @@ public void testFileSearchEmpty() throws IOException { @Test public void testFileSearchEverything() throws IOException { + // on newer server we have Talk folder + int offset = 0; + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + offset = 1; + } + for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; @@ -108,7 +116,7 @@ public void testFileSearchEverything() throws IOException { RemoteOperationResult> result = sut.execute(client); assertTrue(result.isSuccess()); - assertEquals(11, result.getResultData().size()); + assertEquals(offset + 10, result.getResultData().size()); } @Test @@ -202,7 +210,14 @@ public void favoriteFiles() throws IOException { assertEquals(2, result.getResultData().size()); assertEquals(remotePath, result.getResultData().get(0).getRemotePath()); - assertEquals(sharedRemotePath, result.getResultData().get(1).getRemotePath()); + + if (capability.getVersion().isNewerOrEqual(OwnCloudVersion.nextcloud_17)) { + assertEquals(sharedRemotePath, result.getResultData().get(1).getRemotePath()); + } else { + // on NC16 we have a bug that each file ends with "/" + sharedRemotePath += "/"; + assertEquals(sharedRemotePath, result.getResultData().get(1).getRemotePath()); + } } /** @@ -210,6 +225,12 @@ public void favoriteFiles() throws IOException { */ @Test public void testRecentlyModifiedSearch() throws IOException { + // on newer server we have Talk folder + int offset = 0; + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + offset = 1; + } + long now = System.currentTimeMillis() / MILLI_TO_SECOND; String filePath = createFile("image"); assertTrue(new UploadFileRemoteOperation(filePath, "/image.jpg", "image/jpg", now - 50) @@ -234,7 +255,7 @@ public void testRecentlyModifiedSearch() throws IOException { RemoteOperationResult> result = sut.execute(client); assertTrue(result.isSuccess()); - assertEquals(4, result.getResultData().size()); + assertEquals(offset + 3, result.getResultData().size()); assertEquals("/video.mp4", result.getResultData().get(0).getRemotePath()); assertEquals("/pdf.pdf", result.getResultData().get(1).getRemotePath()); @@ -399,6 +420,8 @@ public void testPhotoSearchLimitAndTimestamp() throws IOException { @Test public void testGallerySearch() throws IOException { + testOnlyOnServer(OwnCloudVersion.nextcloud_18); + for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; @@ -425,6 +448,12 @@ public void testGallerySearch() throws IOException { @Test public void showOnlyFolders() throws IOException { + // on newer server we have Talk folder + int offset = 0; + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + offset = 1; + } + for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; @@ -438,13 +467,13 @@ public void showOnlyFolders() throws IOException { RemoteOperationResult> result = sut.execute(client); assertTrue(result.isSuccess()); - assertEquals(1, result.getResultData().size()); + assertEquals(0 + offset, result.getResultData().size()); assertTrue(new CreateFolderRemoteOperation("/folder/", false).execute(client).isSuccess()); result = sut.execute(client); assertTrue(result.isSuccess()); - assertEquals(2, result.getResultData().size()); + assertEquals(1 + offset, result.getResultData().size()); assertEquals("/folder/", result.getResultData().get(0).getRemotePath()); } diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/UploadFileRemoteOperationIT.kt b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/UploadFileRemoteOperationIT.kt index 8376af46c..f803ab8b0 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/UploadFileRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/UploadFileRemoteOperationIT.kt @@ -11,6 +11,9 @@ import android.os.Build import com.owncloud.android.AbstractIT import com.owncloud.android.lib.common.utils.Log_OC import com.owncloud.android.lib.resources.files.model.RemoteFile +import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation +import com.owncloud.android.lib.resources.status.OCCapability +import com.owncloud.android.lib.resources.status.OwnCloudVersion import junit.framework.TestCase.assertEquals import org.junit.Assert.assertNotNull import org.junit.Assert.assertTrue @@ -32,6 +35,10 @@ class UploadFileRemoteOperationIT : AbstractIT() { @Test fun upload() { + val ocCapability = + GetCapabilitiesRemoteOperation() + .execute(nextcloudClient).singleData as OCCapability + // create file val filePath = createFile("text") val remotePath = "/test.md" @@ -59,12 +66,15 @@ class UploadFileRemoteOperationIT : AbstractIT() { var remoteFile = result.data[0] as RemoteFile assertEquals(remotePath, remoteFile.remotePath) - assertEquals(creationTimestamp, remoteFile.creationTimestamp) assertEquals(uploadResult.resultData, remoteFile.etag) - assertTrue( - uploadTimestamp - TIME_OFFSET < remoteFile.uploadTimestamp || - uploadTimestamp + TIME_OFFSET > remoteFile.uploadTimestamp - ) + + if (ocCapability.version.isNewerOrEqual(OwnCloudVersion.nextcloud_18)) { + assertEquals(creationTimestamp, remoteFile.creationTimestamp) + assertTrue( + uploadTimestamp - TIME_OFFSET < remoteFile.uploadTimestamp || + uploadTimestamp + TIME_OFFSET > remoteFile.uploadTimestamp + ) + } // ReadFolderRemoteOperation result = ReadFolderRemoteOperation(remotePath).execute(client) @@ -73,11 +83,14 @@ class UploadFileRemoteOperationIT : AbstractIT() { remoteFile = result.data[0] as RemoteFile assertEquals(remotePath, remoteFile.remotePath) - assertEquals(creationTimestamp, remoteFile.creationTimestamp) - assertTrue( - uploadTimestamp - TIME_OFFSET < remoteFile.uploadTimestamp || - uploadTimestamp + TIME_OFFSET > remoteFile.uploadTimestamp - ) + + if (ocCapability.version.isNewerOrEqual(OwnCloudVersion.nextcloud_18)) { + assertEquals(creationTimestamp, remoteFile.creationTimestamp) + assertTrue( + uploadTimestamp - TIME_OFFSET < remoteFile.uploadTimestamp || + uploadTimestamp + TIME_OFFSET > remoteFile.uploadTimestamp + ) + } } private fun getCreationTimestamp(file: File): Long? { diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java index 58ed2ac25..27d2f0cb3 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java @@ -27,6 +27,7 @@ import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation; import com.owncloud.android.lib.resources.status.NextcloudVersion; import com.owncloud.android.lib.resources.status.OCCapability; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import junit.framework.TestCase; @@ -154,6 +155,8 @@ private void assertFolderAttributes(final OCShare share, final String expectedDi @Test public void sharedWithMe() { + testOnlyOnServer(OwnCloudVersion.nextcloud_19); + GetSharesRemoteOperation sut = new GetSharesRemoteOperation(); GetSharesRemoteOperation sutSharedWithMe = new GetSharesRemoteOperation(true); diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/users/AppTokenRemoteOperationIT.kt b/library/src/androidTest/java/com/owncloud/android/lib/resources/users/AppTokenRemoteOperationIT.kt index 53802ec18..3642fbf05 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/users/AppTokenRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/users/AppTokenRemoteOperationIT.kt @@ -9,6 +9,7 @@ package com.owncloud.android.lib.resources.users import androidx.test.platform.app.InstrumentationRegistry import com.owncloud.android.AbstractIT +import com.owncloud.android.lib.resources.status.OwnCloudVersion import junit.framework.Assert.assertFalse import junit.framework.Assert.assertTrue import okhttp3.Credentials.basic @@ -57,6 +58,8 @@ class AppTokenRemoteOperationIT : AbstractIT() { @Test fun deleteAppPassword() { + testOnlyOnServer(OwnCloudVersion.nextcloud_17) + val arguments = InstrumentationRegistry.getArguments() val username: String = arguments.getString("TEST_SERVER_USERNAME", "") val password: String = arguments.getString("TEST_SERVER_PASSWORD", "") From 65959456918b808d894acc4e3cab9e1705c0611d Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 29 Apr 2024 15:23:39 +0200 Subject: [PATCH 38/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configNC_master.sh | 20 +++++++++---------- .github/workflows/configNC_stable16.sh | 5 ++++- ...ashboardGetWidgetItemsRemoteOperationIT.kt | 8 ++++++-- .../files/SearchRemoteOperationIT.java | 10 +++++++--- .../resources/notifications/NotificationIT.kt | 3 +++ scripts/uploadReport.sh | 2 +- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/workflows/configNC_master.sh b/.github/workflows/configNC_master.sh index 7a9a4fc40..dd984af97 100644 --- a/.github/workflows/configNC_master.sh +++ b/.github/workflows/configNC_master.sh @@ -24,40 +24,40 @@ php /var/www/html/occ group:adduser users user1 php /var/www/html/occ group:adduser users user2 php /var/www/html/occ group:adduser users test -git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ +git clone --depth=1 -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ php /var/www/html/occ app:enable activity -git clone -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/ +git clone --depth=1 -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/ php /var/www/html/occ app:enable text -git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ +git clone --depth=1 -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/ php /var/www/html/occ app:enable end_to_end_encryption -git clone -b master https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ +git clone --depth=1 -b master https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ php /var/www/html/occ app:enable password_policy -git clone -b master https://github.com/nextcloud/external/ /var/www/html/apps/external/ +git clone --depth=1 -b master https://github.com/nextcloud/external/ /var/www/html/apps/external/ cd /var/www/html/apps/external; composer install --no-dev php /var/www/html/occ app:enable external php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}" -git clone -b main https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ +git clone --depth=1 -b main https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/ php /var/www/html/occ app:enable -f files_lock -git clone https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ +git clone --depth=1 https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/ php /var/www/html/occ app:enable -f groupfolders php /var/www/html/occ groupfolders:create groupfolder php /var/www/html/occ groupfolders:group 1 users -git clone https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ +git clone --depth=1 https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ php /var/www/html/occ app:enable -f notifications php /var/www/html/occ notification:generate test -d test -git clone https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ +git clone --depth=1 https://github.com/nextcloud/photos.git /var/www/html/apps/photos/ cd /var/www/html/apps/photos; composer install --no-dev php /var/www/html/occ app:enable -f photos -git clone https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ +git clone --depth=1 https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/ cd /var/www/html/apps/assistant; source ~/.bashrc; make php /var/www/html/occ app:enable -f assistant diff --git a/.github/workflows/configNC_stable16.sh b/.github/workflows/configNC_stable16.sh index 5760844ef..ea8e53aa5 100644 --- a/.github/workflows/configNC_stable16.sh +++ b/.github/workflows/configNC_stable16.sh @@ -21,12 +21,15 @@ php /var/www/html/occ group:adduser users user1 php /var/www/html/occ group:adduser users user2 php /var/www/html/occ group:adduser users test +git clone --depth=1 -b $SERVER_VERSION https://github.com/nextcloud/activity.git /var/www/html/apps/activity/ php /var/www/html/occ app:enable activity +git clone --depth=1 -b $SERVER_VERSION https://github.com/nextcloud/text.git /var/www/html/apps/text/ php /var/www/html/occ app:enable text php /var/www/html/occ app:enable end_to_end_encryption +git clone --depth=1 -b $SERVER_VERSION https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/ php /var/www/html/occ app:enable password_policy php /var/www/html/occ app:enable external @@ -36,7 +39,7 @@ php /var/www/html/occ app:enable groupfolders php /var/www/html/occ groupfolders:create groupfolder php /var/www/html/occ groupfolders:group 1 users -git clone -b $SERVER_VERSION https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ +git clone --depth=1 -b $SERVER_VERSION https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/ php /var/www/html/occ app:enable notifications php /var/www/html/occ app:enable testing diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardGetWidgetItemsRemoteOperationIT.kt b/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardGetWidgetItemsRemoteOperationIT.kt index a2e9aed38..b10e8ee8f 100644 --- a/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardGetWidgetItemsRemoteOperationIT.kt +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardGetWidgetItemsRemoteOperationIT.kt @@ -14,14 +14,18 @@ import com.owncloud.android.lib.resources.shares.OCShare import com.owncloud.android.lib.resources.shares.ShareType import com.owncloud.android.lib.resources.status.NextcloudVersion import org.junit.Assert.assertTrue +import org.junit.Before import org.junit.Test class DashboardGetWidgetItemsRemoteOperationIT : AbstractIT() { - @Test - fun getItems() { + @Before + fun before() { // only on NC25+ testOnlyOnServer(NextcloudVersion.nextcloud_25) + } + @Test + fun getItems() { // create folder to have some content assertTrue(CreateFolderRemoteOperation("/testFolder", false).execute(client2).isSuccess) assertTrue( diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index 71e77449c..1269ac57c 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -98,7 +98,8 @@ public void testFileSearchEmpty() throws IOException { public void testFileSearchEverything() throws IOException { // on newer server we have Talk folder int offset = 0; - if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { offset = 1; } @@ -227,7 +228,8 @@ public void favoriteFiles() throws IOException { public void testRecentlyModifiedSearch() throws IOException { // on newer server we have Talk folder int offset = 0; - if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { offset = 1; } @@ -449,8 +451,10 @@ public void testGallerySearch() throws IOException { @Test public void showOnlyFolders() throws IOException { // on newer server we have Talk folder + // on NC16 groupfolder is also returned int offset = 0; - if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20)) { + if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { offset = 1; } diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/notifications/NotificationIT.kt b/library/src/androidTest/java/com/owncloud/android/lib/resources/notifications/NotificationIT.kt index ba34b46fb..ecef8e300 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/notifications/NotificationIT.kt +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/notifications/NotificationIT.kt @@ -8,6 +8,7 @@ package com.owncloud.android.lib.resources.notifications import com.owncloud.android.AbstractIT +import com.owncloud.android.lib.resources.status.OwnCloudVersion import junit.framework.TestCase.assertEquals import junit.framework.TestCase.assertTrue import org.junit.Test @@ -22,6 +23,8 @@ class NotificationIT : AbstractIT() { val count = all.resultData.size // get one + testOnlyOnServer(OwnCloudVersion.nextcloud_17) + val firstNotification = all.resultData[0] val first = GetNotificationRemoteOperation(firstNotification.notificationId).execute(nextcloudClient) assertTrue(first.isSuccess) diff --git a/scripts/uploadReport.sh b/scripts/uploadReport.sh index f706f31fe..868b8aa45 100755 --- a/scripts/uploadReport.sh +++ b/scripts/uploadReport.sh @@ -39,7 +39,7 @@ fi find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$REMOTE_FOLDER/$(echo {} | sed s#\./##) \; find . -type f -exec curl -u $USER:$PASS -X PUT $URL/$REMOTE_FOLDER/$(echo {} | sed s#\./##) --upload-file {} \; -echo "Uploaded failing library tests to https://www.kaminsky.me/nc-dev/android-library-integrationTests/$REMOTE_FOLDER" +echo "Uploaded failing library tests to https://www.kaminsky.me/nc-dev/android-library-integrationTests/$REMOTE_FOLDER/debug/" curl -u $GIT_USERNAME:$GIT_TOKEN -X POST https://api.github.com/repos/nextcloud/android-library/issues/$PR_ID/comments -d "{ \"body\" : \"$BRANCH_TYPE test failed: https://www.kaminsky.me/nc-dev/android-library-integrationTests/$REMOTE_FOLDER/debug/ \" }" exit 1 From 4366f117ac498007e430f291eb2c9d2590f7cb39 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 20 Jun 2024 08:11:53 +0200 Subject: [PATCH 39/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/configNC_master.sh | 3 +++ .github/workflows/configServer.sh | 1 + scripts/createDockerTestContainer.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100755 scripts/createDockerTestContainer.sh diff --git a/.github/workflows/configNC_master.sh b/.github/workflows/configNC_master.sh index dd984af97..8f9530d0c 100644 --- a/.github/workflows/configNC_master.sh +++ b/.github/workflows/configNC_master.sh @@ -9,6 +9,9 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + source ~/.bashrc; nvm install node php /var/www/html/occ log:manage --level warning diff --git a/.github/workflows/configServer.sh b/.github/workflows/configServer.sh index f9eef62ae..a44431413 100644 --- a/.github/workflows/configServer.sh +++ b/.github/workflows/configServer.sh @@ -6,6 +6,7 @@ # SPDX-License-Identifier: MIT # +wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg apt-get update && apt-get install -y composer mkdir /var/www/.nvm /var/www/.npm touch /var/www/.bashrc diff --git a/scripts/createDockerTestContainer.sh b/scripts/createDockerTestContainer.sh new file mode 100755 index 000000000..6ad2af78a --- /dev/null +++ b/scripts/createDockerTestContainer.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Nextcloud Android Library +# +# SPDX-FileCopyrightText: 2024 Tobias Kaminsky +# SPDX-License-Identifier: MIT +# + +if [[ $# -ne 1 ]]; then + echo "please specify stable29 or master as first parameter" + exit +fi + +docker stop testNC +docker rm testNC +docker run --name=testNC ghcr.io/nextcloud/continuous-integration-shallow-server:latest & +sleep 60 + +docker cp ../.github/workflows/configServer.sh testNC:/tmp/ +docker exec testNC chmod +x /tmp/configServer.sh +docker exec testNC /tmp/configServer.sh $1 +docker cp ../.github/workflows/configNC_$1.sh testNC:/tmp/ +docker exec testNC chmod +x /tmp/configNC_$1.sh +docker exec --user www-data testNC /tmp/configNC_$1.sh + +echo "Docker IP Address is:" +docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' testNC From de29d73838377b21dcba1b0d539b9ebd9884f990 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 31 Oct 2024 15:24:34 +0100 Subject: [PATCH 40/65] try ubuntu-latest Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 215eeabc8..fbba187ea 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -13,7 +13,7 @@ permissions: jobs: test: - runs-on: ubuntu-22.04 # our own GARM does not yet support it + runs-on: ubuntu-latest services: server: image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest @@ -109,7 +109,7 @@ jobs: retention-days: 4 stable16: - runs-on: ubuntu-22.04 # our own GARM does not yet support it + runs-on: ubuntu-latest services: server: image: nextcloudci/server:server-13 From 9742f4a6f7cce8cfdac2f83a4450078aeaf88bf3 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 31 Oct 2024 15:32:55 +0100 Subject: [PATCH 41/65] no kvm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index fbba187ea..195df33f4 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -139,11 +139,6 @@ jobs: docker exec server chmod +x /tmp/configNC_stable16.sh docker exec --user www-data server /tmp/configNC_stable16.sh - - 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 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: From 2c65887139fe6dd58e1535954b24bc2649adce73 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 31 Oct 2024 16:05:56 +0100 Subject: [PATCH 42/65] no kvm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 195df33f4..277a01f29 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -13,7 +13,7 @@ permissions: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-kvm services: server: image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest @@ -109,7 +109,7 @@ jobs: retention-days: 4 stable16: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-vkm services: server: image: nextcloudci/server:server-13 From abe70367b1e77752be677b3fda82babd3f6c4dd2 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 31 Oct 2024 16:11:25 +0100 Subject: [PATCH 43/65] re-enable kvm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 277a01f29..3923f2bc5 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -139,6 +139,11 @@ jobs: docker exec server chmod +x /tmp/configNC_stable16.sh docker exec --user www-data server /tmp/configNC_stable16.sh + - 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 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: From 54e82e2428803a52f6ea5767b7ff0212e72759bb Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 31 Oct 2024 16:25:51 +0100 Subject: [PATCH 44/65] again no kvm Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 3923f2bc5..8a9381def 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -45,12 +45,6 @@ jobs: docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh docker exec server /usr/local/bin/run.sh - - 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 - - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: distribution: "temurin" @@ -139,12 +133,6 @@ jobs: docker exec server chmod +x /tmp/configNC_stable16.sh docker exec --user www-data server /tmp/configNC_stable16.sh - - 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 - - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: distribution: "temurin" From 079f1ee66426da23a5db0ad89471dd93872612dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 31 Oct 2024 19:49:41 +0100 Subject: [PATCH 45/65] debug kvm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 8a9381def..2bfaae217 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -11,20 +11,18 @@ permissions: contents: read pull-requests: write +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest-kvm - services: - server: - image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest - options: --name server - ports: - - 80:80 strategy: fail-fast: false matrix: - server: [ master, stable29 ] - api-level: [ 18, 27 ] + server: [ master ] + api-level: [ 18 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -37,13 +35,10 @@ jobs: - name: configure server run: | - docker cp .github/workflows/configServer.sh server:/tmp/ - docker exec server chmod +x /tmp/configServer.sh - docker exec server /tmp/configServer.sh ${{ matrix.server }} - docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ - docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh - docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh - docker exec server /usr/local/bin/run.sh + ls -ahl /dev/kvm + apt update && apt install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes + kvm-ok + chmod 666 /dev/kvm - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: From 8d38410b9702aedbea52e4a8166df85d42ea18d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 31 Oct 2024 19:50:29 +0100 Subject: [PATCH 46/65] no ping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 2bfaae217..c4ed28367 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -26,13 +26,6 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: wait and ping server - run: | - while ! curl http://localhost/status.php 2>&1 | grep installed; do - echo "wait…" - sleep 5 - done - - name: configure server run: | ls -ahl /dev/kvm From 7333170dcbacb93e391e6ec461d5ef23b92a8e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 31 Oct 2024 19:51:50 +0100 Subject: [PATCH 47/65] sudo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index c4ed28367..dcb4a2f9c 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -29,9 +29,9 @@ jobs: - name: configure server run: | ls -ahl /dev/kvm - apt update && apt install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes + sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes kvm-ok - chmod 666 /dev/kvm + sudo chmod 666 /dev/kvm - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: From e7ec67e2ebd53939062ff33ef3c9cde4a29e4b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 31 Oct 2024 19:58:43 +0100 Subject: [PATCH 48/65] update action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index dcb4a2f9c..65a69142c 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -39,7 +39,7 @@ jobs: java-version: 17 - name: create AVD and generate snapshot for caching - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 with: api-level: ${{ matrix.api-level }} force-avd-creation: false From 4cc5733e2f5d94d280b41c22e4eb1577c110ce76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Thu, 31 Oct 2024 20:03:17 +0100 Subject: [PATCH 49/65] put together MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 65a69142c..f8dcc3503 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -18,19 +18,37 @@ concurrency: jobs: test: runs-on: ubuntu-latest-kvm + services: + server: + image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest + options: --name server + ports: + - 80:80 strategy: fail-fast: false matrix: - server: [ master ] - api-level: [ 18 ] + server: [ master, stable29 ] + api-level: [ 18, 27 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: wait and ping server + run: | + while ! curl http://localhost/status.php 2>&1 | grep installed; do + echo "wait…" + sleep 5 + done + - name: configure server run: | - ls -ahl /dev/kvm + docker cp .github/workflows/configServer.sh server:/tmp/ + docker exec server chmod +x /tmp/configServer.sh + docker exec server /tmp/configServer.sh ${{ matrix.server }} + docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh + docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh + docker exec server /usr/local/bin/run.sh sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes - kvm-ok sudo chmod 666 /dev/kvm - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 @@ -64,7 +82,7 @@ jobs: - name: gplay env: SHOT_TEST: "true" - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 with: api-level: ${{ matrix.api-level }} force-avd-creation: false @@ -91,7 +109,7 @@ jobs: retention-days: 4 stable16: - runs-on: ubuntu-latest-vkm + runs-on: ubuntu-latest-kvm services: server: image: nextcloudci/server:server-13 @@ -127,7 +145,7 @@ jobs: java-version: 17 - name: create AVD and generate snapshot for caching - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 with: api-level: ${{ matrix.api-level }} force-avd-creation: false @@ -152,7 +170,7 @@ jobs: - name: gplay env: SHOT_TEST: "true" - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 with: api-level: ${{ matrix.api-level }} force-avd-creation: false From 8e32becf802071d30815a1ddd6afc13ef42764dc Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 1 Nov 2024 11:02:01 +0100 Subject: [PATCH 50/65] wip Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 183 +++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 91 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index f8dcc3503..bc176a84c 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -27,10 +27,10 @@ jobs: strategy: fail-fast: false matrix: - server: [ master, stable29 ] - api-level: [ 18, 27 ] + server: [ master ] # [ master, stable29 ] + api-level: [ 18 ] # [ 18, 27 ] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: wait and ping server run: | @@ -51,7 +51,8 @@ jobs: sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm - - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + - name: set up JDK 17 + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: distribution: "temurin" java-version: 17 @@ -108,90 +109,90 @@ jobs: path: app/build/reports retention-days: 4 - stable16: - runs-on: ubuntu-latest-kvm - services: - server: - image: nextcloudci/server:server-13 - options: --name server - ports: - - 80:80 - strategy: - fail-fast: false - matrix: - api-level: [ 27 ] - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: wait and ping server - run: | - while ! curl http://localhost/status.php 2>&1 | grep installed; do - echo "wait…" - sleep 5 - done - - - name: configure server - run: | - docker cp .github/workflows/configServer16.sh server:/tmp/ - docker exec server chmod +x /tmp/configServer16.sh - docker exec server /tmp/configServer16.sh - docker cp .github/workflows/configNC_stable16.sh server:/tmp/ - docker exec server chmod +x /tmp/configNC_stable16.sh - docker exec --user www-data server /tmp/configNC_stable16.sh - - - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: "temurin" - java-version: 17 - - - name: create AVD and generate snapshot for caching - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 - with: - api-level: ${{ matrix.api-level }} - force-avd-creation: false - arch: x86 - sdcard-path-or-size: 100M - target: google_apis - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: echo "Generated AVD snapshot for caching." - - - name: Configure gradle daemon - run: | - mkdir -p $HOME/.gradle - echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties - echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties - - - name: Build gplay # TODO build only once! - run: | - sed -i s#https://server#http://10.0.2.2# gradle.properties - sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt - ./gradlew assembleDebug - - - name: gplay - env: - SHOT_TEST: "true" - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 - with: - api-level: ${{ matrix.api-level }} - force-avd-creation: false - arch: x86 - sdcard-path-or-size: 100M - target: google_apis - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: scripts/runTests.sh - - - name: upload failing results - if: ${{ failure() }} - env: - LOG_USERNAME: ${{ secrets.LOG_USERNAME }} - LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} - GIT_USERNAME: ${{ secrets.GIT_USERNAME }} - GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "master" "IT" ${{github.event.number}} "${{ secrets.GIT_USERNAME }}" "${{ secrets.GIT_TOKEN }}" - - name: Archive Espresso results - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - if: ${{ always() }} - with: - name: Report-${{ matrix.server }}-${{ matrix.api-level }} - path: app/build/reports - retention-days: 4 +# stable16: +# runs-on: ubuntu-latest-kvm +# services: +# server: +# image: nextcloudci/server:server-13 +# options: --name server +# ports: +# - 80:80 +# strategy: +# fail-fast: false +# matrix: +# api-level: [ 27 ] +# steps: +# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 +# +# - name: wait and ping server +# run: | +# while ! curl http://localhost/status.php 2>&1 | grep installed; do +# echo "wait…" +# sleep 5 +# done +# +# - name: configure server +# run: | +# docker cp .github/workflows/configServer16.sh server:/tmp/ +# docker exec server chmod +x /tmp/configServer16.sh +# docker exec server /tmp/configServer16.sh +# docker cp .github/workflows/configNC_stable16.sh server:/tmp/ +# docker exec server chmod +x /tmp/configNC_stable16.sh +# docker exec --user www-data server /tmp/configNC_stable16.sh +# +# - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 +# with: +# distribution: "temurin" +# java-version: 17 +# +# - name: create AVD and generate snapshot for caching +# uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 +# with: +# api-level: ${{ matrix.api-level }} +# force-avd-creation: false +# arch: x86 +# sdcard-path-or-size: 100M +# target: google_apis +# emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 +# script: echo "Generated AVD snapshot for caching." +# +# - name: Configure gradle daemon +# run: | +# mkdir -p $HOME/.gradle +# echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties +# echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties +# +# - name: Build gplay # TODO build only once! +# run: | +# sed -i s#https://server#http://10.0.2.2# gradle.properties +# sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt +# ./gradlew assembleDebug +# +# - name: gplay +# env: +# SHOT_TEST: "true" +# uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 +# with: +# api-level: ${{ matrix.api-level }} +# force-avd-creation: false +# arch: x86 +# sdcard-path-or-size: 100M +# target: google_apis +# emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 +# script: scripts/runTests.sh +# +# - name: upload failing results +# if: ${{ failure() }} +# env: +# LOG_USERNAME: ${{ secrets.LOG_USERNAME }} +# LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} +# GIT_USERNAME: ${{ secrets.GIT_USERNAME }} +# GIT_TOKEN: ${{ secrets.GIT_TOKEN }} +# run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "master" "IT" ${{github.event.number}} "${{ secrets.GIT_USERNAME }}" "${{ secrets.GIT_TOKEN }}" +# - name: Archive Espresso results +# uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 +# if: ${{ always() }} +# with: +# name: Report-${{ matrix.server }}-${{ matrix.api-level }} +# path: app/build/reports +# retention-days: 4 From 0d4394c7f2a0c4789dde9a4603226c7889813ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 11:55:45 +0100 Subject: [PATCH 51/65] env sdk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index bc176a84c..c255783b3 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -50,6 +50,7 @@ jobs: docker exec server /usr/local/bin/run.sh sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm + export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" - name: set up JDK 17 uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 From 9615c0bf4f663e4a38c3b816aa5fdcbb5a634519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:03:48 +0100 Subject: [PATCH 52/65] no avd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index c255783b3..f0684800f 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -58,17 +58,6 @@ jobs: distribution: "temurin" java-version: 17 - - name: create AVD and generate snapshot for caching - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 - with: - api-level: ${{ matrix.api-level }} - force-avd-creation: false - arch: x86 - sdcard-path-or-size: 100M - target: google_apis - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 - script: echo "Generated AVD snapshot for caching." - - name: Configure gradle daemon run: | mkdir -p $HOME/.gradle From a118373980cd3cc13d32a099c2d7014d45323df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:16:25 +0100 Subject: [PATCH 53/65] debug run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 54 +++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index f0684800f..f7d358498 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -18,12 +18,12 @@ concurrency: jobs: test: runs-on: ubuntu-latest-kvm - services: - server: - image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest - options: --name server - ports: - - 80:80 +# services: +# server: +# image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest +# options: --name server +# ports: +# - 80:80 strategy: fail-fast: false matrix: @@ -32,25 +32,26 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: wait and ping server - run: | - while ! curl http://localhost/status.php 2>&1 | grep installed; do - echo "wait…" - sleep 5 - done - +# - name: wait and ping server +# run: | +# while ! curl http://localhost/status.php 2>&1 | grep installed; do +# echo "wait…" +# sleep 5 +# done +# - name: configure server run: | - docker cp .github/workflows/configServer.sh server:/tmp/ - docker exec server chmod +x /tmp/configServer.sh - docker exec server /tmp/configServer.sh ${{ matrix.server }} - docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ - docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh - docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh - docker exec server /usr/local/bin/run.sh sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" +# docker cp .github/workflows/configServer.sh server:/tmp/ +# docker exec server chmod +x /tmp/configServer.sh +# docker exec server /tmp/configServer.sh ${{ matrix.server }} +# docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ +# docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh +# docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh +# docker exec server /usr/local/bin/run.sh + - name: set up JDK 17 uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 @@ -58,6 +59,17 @@ jobs: distribution: "temurin" java-version: 17 +# - name: create AVD and generate snapshot for caching +# uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 +# with: +# api-level: ${{ matrix.api-level }} +# force-avd-creation: false +# arch: x86 +# sdcard-path-or-size: 100M +# target: google_apis +# emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 +# script: echo "Generated AVD snapshot for caching." + - name: Configure gradle daemon run: | mkdir -p $HOME/.gradle @@ -68,7 +80,7 @@ jobs: run: | sed -i s#https://server#http://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt - ./gradlew assembleDebug + ./gradlew assembleDebug --debug - name: gplay env: From 66e7d0f2941b342df61904cbb6554c737abcd4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:23:47 +0100 Subject: [PATCH 54/65] gradle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index bdfb4a4ce..aaa8bbd5d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ NC_TEST_SERVER_PASSWORD=test NC_TEST_SERVER_USERNAME2=admin NC_TEST_SERVER_PASSWORD2=admin android.useAndroidX=true -android.defaults.buildfeatures.buildconfig=true +#android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false android.nonFinalResIds=false From 627f68ae0b4bd34ed11f027fb0ce6cf1bcd4d34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:25:15 +0100 Subject: [PATCH 55/65] gradle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index f7d358498..a6ed8d772 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -41,9 +41,9 @@ jobs: # - name: configure server run: | - sudo apt-get update && sudo apt-get install unzip openjdk-21-jdk-headless cpu-checker qemu-kvm --yes + sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm - export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" +# export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" # docker cp .github/workflows/configServer.sh server:/tmp/ # docker exec server chmod +x /tmp/configServer.sh # docker exec server /tmp/configServer.sh ${{ matrix.server }} @@ -80,7 +80,7 @@ jobs: run: | sed -i s#https://server#http://10.0.2.2# gradle.properties sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt - ./gradlew assembleDebug --debug + ./gradlew assembleDebug --info - name: gplay env: From c7b35fc99d6486302b07ef23bdd7c72db85b4c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:28:39 +0100 Subject: [PATCH 56/65] jdk and path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 11 ++++++----- gradle.properties | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index a6ed8d772..adf38097e 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -43,6 +43,7 @@ jobs: run: | sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm + echo $PATH # export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" # docker cp .github/workflows/configServer.sh server:/tmp/ # docker exec server chmod +x /tmp/configServer.sh @@ -53,11 +54,11 @@ jobs: # docker exec server /usr/local/bin/run.sh - - name: set up JDK 17 - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: "temurin" - java-version: 17 +# - name: set up JDK 17 +# uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 +# with: +# distribution: "temurin" +# java-version: 17 # - name: create AVD and generate snapshot for caching # uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 diff --git a/gradle.properties b/gradle.properties index aaa8bbd5d..bdfb4a4ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ NC_TEST_SERVER_PASSWORD=test NC_TEST_SERVER_USERNAME2=admin NC_TEST_SERVER_PASSWORD2=admin android.useAndroidX=true -#android.defaults.buildfeatures.buildconfig=true +android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false android.nonFinalResIds=false From a59402390aee677da44535e1557cb252e82b52de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:32:53 +0100 Subject: [PATCH 57/65] env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index adf38097e..1713e2819 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -44,6 +44,12 @@ jobs: sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm echo $PATH + export ANDROID_NDK=/usr/local/lib/android/sdk/ndk/27.2.12479018 + export ANDROID_NDK_LATEST_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 + export ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 + export ANDROID_HOME=/usr/local/lib/android/sdk + export ANDROID_SDK_ROOT=/usr/local/lib/android/sdk + export ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/27.2.12479018 # export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" # docker cp .github/workflows/configServer.sh server:/tmp/ # docker exec server chmod +x /tmp/configServer.sh From 05a905b0921337f103d69067b8c0b7b6cbb830e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 12:35:31 +0100 Subject: [PATCH 58/65] env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 1713e2819..6f108b0ca 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -44,6 +44,8 @@ jobs: sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm echo $PATH + echo $ANDROID_HOME + echo $ANDROID_SDK_ROOT export ANDROID_NDK=/usr/local/lib/android/sdk/ndk/27.2.12479018 export ANDROID_NDK_LATEST_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 export ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 From cdf247d6e2f32406307d0910bda0d3ed95142045 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 1 Nov 2024 13:56:45 +0100 Subject: [PATCH 59/65] wip Signed-off-by: tobiasKaminsky --- .../android/lib/resources/files/SearchRemoteOperationIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index 1269ac57c..fa04934f6 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -99,7 +99,7 @@ public void testFileSearchEverything() throws IOException { // on newer server we have Talk folder int offset = 0; if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || - capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_17.getMajorVersionNumber()) { offset = 1; } @@ -229,7 +229,7 @@ public void testRecentlyModifiedSearch() throws IOException { // on newer server we have Talk folder int offset = 0; if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || - capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_17.getMajorVersionNumber()) { offset = 1; } From fab268db26166bee1fdab876af1f2e7709d7f7f4 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 1 Nov 2024 14:04:42 +0100 Subject: [PATCH 60/65] wip Signed-off-by: tobiasKaminsky --- .../android/lib/resources/files/SearchRemoteOperationIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index fa04934f6..58f62c385 100644 --- a/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java +++ b/library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -454,7 +454,7 @@ public void showOnlyFolders() throws IOException { // on NC16 groupfolder is also returned int offset = 0; if (capability.getVersion().isNewerOrEqual(NextcloudVersion.nextcloud_20) || - capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_16.getMajorVersionNumber()) { + capability.getVersion().getMajorVersionNumber() == NextcloudVersion.nextcloud_17.getMajorVersionNumber()) { offset = 1; } From 3ab47cf0387130fe86d3ff4cf9f190eeb565481c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 1 Nov 2024 16:59:38 +0100 Subject: [PATCH 61/65] add services again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .github/workflows/garm.yml | 81 ++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 46 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 6f108b0ca..80113c16b 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -18,12 +18,12 @@ concurrency: jobs: test: runs-on: ubuntu-latest-kvm -# services: -# server: -# image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest -# options: --name server -# ports: -# - 80:80 + services: + server: + image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest + options: --name server + ports: + - 80:80 strategy: fail-fast: false matrix: @@ -32,52 +32,41 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 -# - name: wait and ping server -# run: | -# while ! curl http://localhost/status.php 2>&1 | grep installed; do -# echo "wait…" -# sleep 5 -# done -# + - name: wait and ping server + run: | + while ! curl http://localhost/status.php 2>&1 | grep installed; do + echo "wait…" + sleep 5 + done + - name: configure server run: | sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes sudo chmod 666 /dev/kvm - echo $PATH - echo $ANDROID_HOME - echo $ANDROID_SDK_ROOT - export ANDROID_NDK=/usr/local/lib/android/sdk/ndk/27.2.12479018 - export ANDROID_NDK_LATEST_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 - export ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk/27.2.12479018 - export ANDROID_HOME=/usr/local/lib/android/sdk - export ANDROID_SDK_ROOT=/usr/local/lib/android/sdk - export ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/27.2.12479018 -# export PATH="/usr/local/lib/android/sdk/cmdline-tools/latest/bin:$PATH" -# docker cp .github/workflows/configServer.sh server:/tmp/ -# docker exec server chmod +x /tmp/configServer.sh -# docker exec server /tmp/configServer.sh ${{ matrix.server }} -# docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ -# docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh -# docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh -# docker exec server /usr/local/bin/run.sh - + docker cp .github/workflows/configServer.sh server:/tmp/ + docker exec server chmod +x /tmp/configServer.sh + docker exec server /tmp/configServer.sh ${{ matrix.server }} + docker cp .github/workflows/configNC_${{ matrix.server }}.sh server:/tmp/ + docker exec server chmod +x /tmp/configNC_${{ matrix.server }}.sh + docker exec --user www-data server /tmp/configNC_${{ matrix.server }}.sh + docker exec server /usr/local/bin/run.sh -# - name: set up JDK 17 -# uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 -# with: -# distribution: "temurin" -# java-version: 17 + - name: set up JDK 17 + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + with: + distribution: "temurin" + java-version: 17 -# - name: create AVD and generate snapshot for caching -# uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 -# with: -# api-level: ${{ matrix.api-level }} -# force-avd-creation: false -# arch: x86 -# sdcard-path-or-size: 100M -# target: google_apis -# emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 -# script: echo "Generated AVD snapshot for caching." + - name: create AVD and generate snapshot for caching + uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + arch: x86 + sdcard-path-or-size: 100M + target: google_apis + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833 + script: echo "Generated AVD snapshot for caching." - name: Configure gradle daemon run: | From 9114774c1121650a58f6515be1839f4faabac1c7 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 6 Nov 2024 11:04:05 +0100 Subject: [PATCH 62/65] use API 27 Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 80113c16b..821094994 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: server: [ master ] # [ master, stable29 ] - api-level: [ 18 ] # [ 18, 27 ] + api-level: [ 27 ] # [ 18, 27 ] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From d6d7d87327b36bcb6ab383e712f88d4bebd8b56d Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 6 Nov 2024 11:45:18 +0100 Subject: [PATCH 63/65] change order Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 821094994..6012b449e 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -32,13 +32,6 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: wait and ping server - run: | - while ! curl http://localhost/status.php 2>&1 | grep installed; do - echo "wait…" - sleep 5 - done - - name: configure server run: | sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes @@ -80,6 +73,13 @@ jobs: sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt ./gradlew assembleDebug --info + - name: wait and ping server + run: | + while ! curl http://localhost/status.php 2>&1 | grep installed; do + echo "wait…" + sleep 5 + done + - name: gplay env: SHOT_TEST: "true" From dcdbebf0e2240daf95ed023783c1bdf3278763fd Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 6 Nov 2024 14:02:11 +0100 Subject: [PATCH 64/65] test on stable30 Signed-off-by: tobiasKaminsky --- .github/workflows/garm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/garm.yml b/.github/workflows/garm.yml index 6012b449e..aa1636a0d 100644 --- a/.github/workflows/garm.yml +++ b/.github/workflows/garm.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - server: [ master ] # [ master, stable29 ] + server: [ stable30 ] # [ master, stable29 ] api-level: [ 27 ] # [ 18, 27 ] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From 2ca1fe35baa38995cad66864d8573fc41d247847 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 6 Nov 2024 14:12:14 +0100 Subject: [PATCH 65/65] test on stable30 Signed-off-by: tobiasKaminsky --- .../workflows/{configNC_stable29.sh => configNC_stable30.sh} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{configNC_stable29.sh => configNC_stable30.sh} (99%) diff --git a/.github/workflows/configNC_stable29.sh b/.github/workflows/configNC_stable30.sh similarity index 99% rename from .github/workflows/configNC_stable29.sh rename to .github/workflows/configNC_stable30.sh index fdfecab09..786768e9e 100644 --- a/.github/workflows/configNC_stable29.sh +++ b/.github/workflows/configNC_stable30.sh @@ -6,7 +6,7 @@ # SPDX-License-Identifier: MIT # -SERVER_VERSION="stable29" +SERVER_VERSION="stable30" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash source ~/.bashrc; nvm install node