Skip to content

Commit b6c500a

Browse files
Garm
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1 parent d2c8c52 commit b6c500a

23 files changed

Lines changed: 290 additions & 2296 deletions

.drone.yml

Lines changed: 0 additions & 369 deletions
This file was deleted.

.github/workflows/configNC.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/bin/sh
2+
3+
# Nextcloud Android Library
4+
#
5+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
6+
# SPDX-License-Identifier: MIT
7+
#
8+
9+
if [ $1 = "master" ]; then
10+
SERVER_VERSION_MAIN="main"
11+
SERVER_VERSION_MASTER="master"
12+
else
13+
SERVER_VERSION_MAIN=$1
14+
SERVER_VERSION_MASTER=$1
15+
fi
16+
17+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
18+
export NVM_DIR="$HOME/.nvm"
19+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
20+
21+
. ~/.bashrc; nvm install node
22+
23+
php /var/www/html/occ log:manage --level warning
24+
25+
OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1
26+
OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2
27+
OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3
28+
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test
29+
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test'
30+
php /var/www/html/occ user:setting user2 files quota 1G
31+
php /var/www/html/occ group:add users
32+
php /var/www/html/occ group:adduser users user1
33+
php /var/www/html/occ group:adduser users user2
34+
php /var/www/html/occ group:adduser users test
35+
36+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/activity.git /var/www/html/apps/activity/
37+
php /var/www/html/occ app:enable -f activity
38+
39+
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/text.git /var/www/html/apps/text/
40+
php /var/www/html/occ app:enable -f text
41+
42+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/
43+
php /var/www/html/occ app:enable -f end_to_end_encryption
44+
45+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/password_policy.git /var/www/html/apps/password_policy/
46+
php /var/www/html/occ app:enable -f password_policy
47+
48+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/external.git /var/www/html/apps/external/
49+
cd /var/www/html/apps/external; composer install --no-dev
50+
php /var/www/html/occ app:enable -f external
51+
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}}"
52+
53+
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/
54+
php /var/www/html/occ app:enable -f files_lock
55+
56+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/groupfolders.git /var/www/html/apps/groupfolders/
57+
php /var/www/html/occ app:enable -f groupfolders
58+
php /var/www/html/occ groupfolders:create groupfolder
59+
php /var/www/html/occ groupfolders:group 1 users
60+
61+
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/
62+
cd /var/www/html/apps/notifications; composer install --no-dev
63+
php /var/www/html/occ app:enable -f notifications
64+
65+
if [ $1 = 'stable22' ]; then
66+
php /var/www/html/occ notification:generate test test
67+
else
68+
php /var/www/html/occ notification:generate test -d test
69+
fi
70+
71+
git clone --depth=1 https://github.com/nextcloud/photos.git /var/www/html/apps/photos/
72+
cd /var/www/html/apps/photos; composer install --no-dev
73+
php /var/www/html/occ app:enable -f photos
74+
75+
git clone --depth=1 https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/
76+
cd /var/www/html/apps/assistant; . ~/.bashrc; make
77+
php /var/www/html/occ app:enable -f assistant
78+
79+
php /var/www/html/occ app:enable -f testing
80+
81+
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/files_downloadlimit.git /var/www/html/apps/files_downloadlimit/
82+
php /var/www/html/occ app:enable -f files_downloadlimit
83+
84+
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/recommendations.git /var/www/html/apps/recommendations/
85+
cd /var/www/html/apps/recommendations; composer install --no-dev
86+
php /var/www/html/occ app:enable -f recommendations
87+
88+
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/viewer.git /var/www/html/apps/viewer/
89+
php /var/www/html/occ app:enable -f viewer
90+
91+
php /var/www/html/occ config:system:set ratelimit.protection.enabled --value false --type bool

.github/workflows/configServer.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
# Nextcloud Android Library
4+
#
5+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
6+
# SPDX-License-Identifier: MIT
7+
#
8+
9+
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
10+
apt-get update && apt-get install -y composer
11+
mkdir /var/www/.nvm /var/www/.npm
12+
mkdir /var/www/.cache/
13+
touch /var/www/.bashrc
14+
chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc /var/www/.cache
15+
16+
rm data -rf
17+
rm config/config.php
18+
BRANCH="$1" /usr/local/bin/initnc.sh

.github/workflows/garm.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: "Garm"
5+
6+
on:
7+
pull_request:
8+
branches: [ master, stable-* ]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-24.04
21+
services:
22+
server:
23+
image: ${{ matrix.server == 'stable22' && 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.0:1' || 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.2:1' }}
24+
options: --name server
25+
ports:
26+
- 80:80
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
server: [ stable22, stable33, master ]
31+
api-level: [ 29 ] # [ 21, 36 ]
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
35+
- name: configure server
36+
run: |
37+
sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes
38+
sudo chmod 666 /dev/kvm
39+
docker cp .github/workflows/configServer.sh server:/tmp/
40+
docker exec server chmod +x /tmp/configServer.sh
41+
docker exec server /tmp/configServer.sh ${{ matrix.server }}
42+
docker cp .github/workflows/configNC.sh server:/tmp/
43+
docker exec server chmod +x /tmp/configNC.sh
44+
docker exec --user www-data server /tmp/configNC.sh ${{ matrix.server }}
45+
docker exec server /usr/local/bin/run.sh
46+
47+
- name: set up JDK 17
48+
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
49+
with:
50+
distribution: "temurin"
51+
java-version: 17
52+
53+
- name: Enable KVM group perms
54+
run: |
55+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
56+
sudo udevadm control --reload-rules
57+
sudo udevadm trigger --name-match=kvm
58+
59+
60+
- name: create AVD and generate snapshot for caching
61+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
62+
with:
63+
api-level: ${{ matrix.api-level }}
64+
force-avd-creation: false
65+
arch: x86
66+
sdcard-path-or-size: 100M
67+
target: google_apis
68+
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
69+
script: echo "Generated AVD snapshot for caching."
70+
71+
- name: Configure gradle daemon
72+
run: |
73+
mkdir -p $HOME/.gradle
74+
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
75+
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
76+
77+
- name: Build gplay
78+
run: |
79+
sed -i s#https://server#http://10.0.2.2# gradle.properties
80+
sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt
81+
./gradlew assembleDebug
82+
83+
- name: wait and ping server
84+
run: |
85+
while ! curl http://localhost/status.php 2>&1 | grep installed; do
86+
echo "wait…"
87+
sleep 5
88+
done
89+
90+
- name: gplay
91+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
92+
with:
93+
api-level: ${{ matrix.api-level }}
94+
force-avd-creation: false
95+
arch: x86
96+
sdcard-path-or-size: 100M
97+
target: google_apis
98+
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
99+
script: scripts/runTests.sh
100+
101+
- name: upload failing results
102+
if: ${{ failure() }}
103+
env:
104+
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
105+
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
106+
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
107+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
108+
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} ${{ matrix.server }} "IT" ${{github.event.number}} "${{ secrets.GIT_USERNAME }}" "${{ secrets.GIT_TOKEN }}"
109+
- name: Archive Espresso results
110+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
111+
if: ${{ always() }}
112+
with:
113+
name: Report-${{ matrix.server }}-${{ matrix.api-level }}
114+
path: app/build/reports
115+
retention-days: 4

library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardGetWidgetItemsRemoteOperationIT.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ import com.owncloud.android.lib.resources.shares.OCShare
1414
import com.owncloud.android.lib.resources.shares.ShareType
1515
import com.owncloud.android.lib.resources.status.NextcloudVersion
1616
import org.junit.Assert.assertTrue
17+
import org.junit.Before
1718
import org.junit.Test
1819

1920
class DashboardGetWidgetItemsRemoteOperationIT : AbstractIT() {
20-
@Test
21-
fun getItems() {
21+
@Before
22+
fun before() {
2223
// only on NC25+
2324
testOnlyOnServer(NextcloudVersion.nextcloud_25)
25+
}
2426

27+
@Test
28+
fun getItems() {
2529
// create folder to have some content
2630
assertTrue(CreateFolderRemoteOperation("/testFolder", false).execute(client2).isSuccess)
2731
assertTrue(

library/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class ReadFileRemoteOperationIT : AbstractIT() {
114114
val remoteFile = result.data[0] as RemoteFile
115115

116116
@Suppress("Detekt.MagicNumber")
117-
if (isServerAtLeast(NextcloudVersion.nextcloud_21)) {
117+
if (isServerAtLeast(NextcloudVersion.nextcloud_23)) {
118118
assertEquals(ImageDimension(451f, 529f), remoteFile.imageDimension)
119119
}
120120

library/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void favoriteFiles() throws IOException {
203203
assertEquals(remotePath, result.getResultData().get(0).getRemotePath());
204204

205205
String expectedSharedRemotePath;
206-
if (isServerAtLeast(NextcloudVersion.nextcloud_21)) {
206+
if (isServerAtLeast(NextcloudVersion.nextcloud_23)) {
207207
expectedSharedRemotePath = sharedRemotePath;
208208
} else {
209209
// Bug: shared search ends with "/" even for files

library/src/androidTest/java/com/owncloud/android/lib/resources/users/StatusIT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class StatusIT : AbstractIT() {
4343

4444
val status = StatusType.entries.toMutableList()
4545

46-
if (!isServerAtLeast(NextcloudVersion.nextcloud_21)) {
46+
if (!isServerAtLeast(NextcloudVersion.nextcloud_23)) {
4747
status.remove(StatusType.BUSY)
4848
}
4949

library/src/androidTest/oldTests/DownloadFileTest.java

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)