Skip to content

Commit 96e0568

Browse files
Merge pull request #2081 from nextcloud/devel
Add support for NC 32 + various fixes
2 parents 2ada653 + cc3a68d commit 96e0568

File tree

20 files changed

+329
-136
lines changed

20 files changed

+329
-136
lines changed

.github/workflows/build-lxd.yml

Lines changed: 69 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "lxd_extra_profile=network" | tee -a "$GITHUB_OUTPUT"
4848
else
4949
LXC_CMD="incus"
50-
RUNNER_LABEL="ubuntu-20.04"
50+
RUNNER_LABEL="ubuntu-latest"
5151
fi
5252
5353
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT
@@ -73,7 +73,7 @@ jobs:
7373
- name: Setup incus
7474
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
7575
run: |
76-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
76+
sudo apt-get install -y incus qemu-system incus-tools
7777
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
7878
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
7979
sudo incus admin init --auto
@@ -341,21 +341,22 @@ jobs:
341341
# }
342342

343343
test-dist-upgrade:
344+
if: false
344345
needs:
345346
- determine-runner
346347
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
347348
env:
348349
VERSION: "${{ inputs.git_ref || github.ref }}"
349350
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
350351
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
351-
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextcloudPi_LXD_arm64_v1.53.0.tar.gz"
352-
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.0/NextCloudPi_LXD_x86_v1.53.0.tar.gz"
352+
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_arm64_v1.53.2.tar.gz"
353+
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextCloudPi_LXD_x86_v1.53.2.tar.gz"
353354
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
354355
steps:
355356
- name: Setup incus
356357
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
357358
run: |
358-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
359+
sudo apt-get install -y incus qemu-system incus-tools
359360
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
360361
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
361362
sudo incus admin init --auto
@@ -364,31 +365,40 @@ jobs:
364365
with:
365366
ref: "v1.54.3"
366367
- name: Setup Firefox
368+
if: ${{ runner.arch != 'ARM64' }}
367369
continue-on-error: true
368370
id: setup-firefox-browser-action
369371
uses: browser-actions/setup-firefox@latest
370372
- name: Setup Firefox from packages
371-
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
373+
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
372374
run: |
375+
sudo apt-get update
373376
sudo apt-get install -y --no-install-recommends firefox
374377
- name: Setup GeckoDriver
375378
env:
376379
GH_TOKEN: ${{ github.token }}
377380
run: |
381+
set -x
378382
arch=linux64
379-
if [[ "$RUNNER_ARCH" == "ARM64" ]]
383+
if [[ "${{ runner.arch }}" == "ARM64" ]]
380384
then
381385
arch="linux-aarch64"
382386
fi
383387
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
384388
tar xf "geckodriver-"*"-$arch.tar.gz"
385389
sudo mv geckodriver /usr/local/bin/
390+
sudo chmod +x /usr/local/bin/geckodriver
391+
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
392+
geckodriver -V
386393
- name: Setup Selenium
387-
run: pip install selenium
394+
run: |
395+
sudo apt-get -y install python3-venv
396+
python3 -m venv ./.venv
397+
./.venv/bin/pip install 'selenium>=3.0.0,<4.0.0'
388398
- name: download LXD image
389399
run: |
390400
image_url="${PREVIOUS_IMAGE_URL_AMD64?}"
391-
if [[ "$RUNNER_ARCH" == "ARM64" ]]
401+
if [[ "${{ runner.arch }}" == "ARM64" ]]
392402
then
393403
image_url="${PREVIOUS_IMAGE_URL_ARM64?}"
394404
fi
@@ -412,8 +422,11 @@ jobs:
412422
- name: Activate and Test LXD Image
413423
working-directory: ./tests
414424
run: |
425+
set -x
426+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
427+
export FF_BINARY_PATH="$(which firefox)"
415428
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
416-
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
429+
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
417430
echo "Activation test failed!"
418431
echo "Geckodriver logs:"
419432
tail -n 20 geckodriver.log >&2 || true
@@ -422,7 +435,7 @@ jobs:
422435
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
423436
exit 1
424437
}
425-
python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
438+
../.venv/bin/python nextcloud_tests.py --skip-release-check --no-gui "nextcloudpi.local" 443 4443 || {
426439
echo "Nextcloud test failed!"
427440
echo "Geckodriver logs:"
428441
tail -n 20 geckodriver.log >&2 || true
@@ -435,8 +448,15 @@ jobs:
435448
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
436449
exit 1
437450
}
438-
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive --skip-update-test || {
451+
sleep 10
452+
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
439453
echo "System test failed!"
454+
echo "ncp.log: "
455+
sudo "$LXC" exec ncp -- "tail -n20 /var/log/ncp.log" || true
456+
echo "================"
457+
echo "nextcloud log: "
458+
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
459+
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
440460
exit 1
441461
}
442462
@@ -457,7 +477,7 @@ jobs:
457477
echo "Running update to ${VERSION}"
458478
459479
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
460-
latest_nc_version="27.1.6"
480+
latest_nc_version="28.0.14"
461481
462482
sudo "$LXC" exec ncp -- apt-get update ||:
463483
sudo "$LXC" exec ncp -- apt-get install --no-install-recommends -y gnupg2
@@ -466,13 +486,13 @@ jobs:
466486
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
467487
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
468488
469-
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
470-
then
471-
echo "Nextcloud is up to date - skipping NC update test."
472-
else
473-
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
474-
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
475-
fi
489+
#if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
490+
#then
491+
# echo "Nextcloud is up to date - skipping NC update test."
492+
#else
493+
# sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
494+
# sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
495+
#fi
476496
477497
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
478498

@@ -493,7 +513,10 @@ jobs:
493513
- name: Test LXD Image
494514
working-directory: ./tests
495515
run: |
496-
python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
516+
set -x
517+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
518+
export FF_BINARY_PATH="$(which firefox)"
519+
../.venv/bin/python nextcloud_tests.py --no-gui --skip-release-check "nextcloudpi.local" 443 4443 || {
497520
echo "Nextcloud test failed!"
498521
echo "Geckodriver logs:"
499522
tail -n 20 geckodriver.log >&2 || true
@@ -507,7 +530,7 @@ jobs:
507530
exit 1
508531
}
509532
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
510-
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive --skip-update-test || {
533+
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive --skip-update-test || {
511534
echo "System test failed!"
512535
exit 1
513536
}
@@ -572,8 +595,11 @@ jobs:
572595
- name: Test LXD Image
573596
working-directory: ./tests
574597
run: |
598+
set -x
599+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
600+
export FF_BINARY_PATH="$(which firefox)"
575601
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
576-
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
602+
../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
577603
echo "Nextcloud test failed!"
578604
echo "Geckodriver logs:"
579605
tail -n 20 geckodriver.log >&2 || true
@@ -586,7 +612,7 @@ jobs:
586612
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
587613
exit 1
588614
}
589-
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive || {
615+
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
590616
echo "System test failed!"
591617
exit 1
592618
}
@@ -612,32 +638,41 @@ jobs:
612638
- name: Setup incus
613639
if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
614640
run: |
615-
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x
641+
sudo apt-get install -y incus qemu-system incus-tools
616642
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
617643
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
618644
sudo incus admin init --auto
619645
- name: Setup Firefox
646+
if: ${{ runner.arch != 'ARM64' }}
620647
continue-on-error: true
621648
id: setup-firefox-browser-action
622649
uses: browser-actions/setup-firefox@latest
623650
- name: Setup Firefox from packages
624-
if: ${{ steps.setup-firefox-browser-action.outcome == 'failure' }}
651+
if: ${{ runner.arch == 'ARM64' || steps.setup-firefox-browser-action.outcome == 'failure' }}
625652
run: |
653+
sudo apt-get update
626654
sudo apt-get install -y --no-install-recommends firefox
627655
- name: Setup GeckoDriver
628656
env:
629657
GH_TOKEN: ${{ github.token }}
630658
run: |
659+
set -x
631660
arch=linux64
632-
if [[ "$RUNNER_ARCH" == "ARM64" ]]
661+
if [[ "${{ runner.arch }}" == "ARM64" ]]
633662
then
634663
arch="linux-aarch64"
635664
fi
636665
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
637666
tar xf "geckodriver-"*"-$arch.tar.gz"
638667
sudo mv geckodriver /usr/local/bin/
668+
sudo chmod +x /usr/local/bin/geckodriver
669+
echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV"
670+
geckodriver -V
639671
- name: Setup Selenium
640-
run: pip install selenium
672+
run: |
673+
sudo apt-get install -y python3-venv
674+
python3 -m venv ./.venv
675+
./.venv/bin/pip install selenium
641676
- name: download LXD image from artifact store
642677
uses: actions/download-artifact@v4
643678
with:
@@ -668,8 +703,11 @@ jobs:
668703
- name: Test LXD Image
669704
working-directory: ./tests
670705
run: |
706+
set -x
707+
export GECKODRIVER_PATH="$GECKODRIVER_PATH"
708+
export FF_BINARY_PATH="$(which firefox)"
671709
sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
672-
python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
710+
../.venv/bin/python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
673711
echo "Activation test failed!"
674712
echo "Geckodriver logs:"
675713
tail -n 20 geckodriver.log >&2 || true
@@ -682,7 +720,7 @@ jobs:
682720
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
683721
exit 1
684722
}
685-
python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
723+
../.venv/bin/python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
686724
echo "Nextcloud test failed!"
687725
echo "Geckodriver logs:"
688726
tail -n 20 geckodriver.log >&2 || true
@@ -695,7 +733,7 @@ jobs:
695733
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
696734
exit 1
697735
}
698-
USE_INCUS="$USE_INCUS" python system_tests.py --non-interactive || {
736+
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
699737
echo "System test failed!"
700738
exit 1
701739
}

.github/workflows/build-sd-images.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
required: false
1616
default: true
1717
type: boolean
18+
test_image_url:
19+
required: false
20+
type: string
21+
default: ""
1822
outputs:
1923
artifact_name:
2024
value: "${{ jobs.build.outputs.artifact_name }}"
@@ -23,7 +27,7 @@ on:
2327

2428
jobs:
2529
build:
26-
runs-on: ubuntu-20.04
30+
runs-on: ubuntu-latest
2731
env:
2832
VERSION: "${{ inputs.git_ref }}"
2933
LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"
@@ -63,7 +67,13 @@ jobs:
6367
# which qemu-aarch64-static
6468
# update-binfmts --display qemu-aarch64
6569
# update-binfmts --display qemu-arm
70+
- name: "Skip build"
71+
if: "${{ inputs.test_image_url != '' }}"
72+
run: |
73+
echo "artifact_file=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_OUTPUT
74+
echo "ARTIFACT_FILE=NextcloudPi_TestImage_${VERSION//\//_}.img" >> $GITHUB_ENV
6675
- name: "Build Armbian"
76+
if: "${{ inputs.test_image_url == '' }}"
6777
id: build-armbian
6878
continue-on-error: true
6979
run: |
@@ -103,6 +113,7 @@ jobs:
103113
name: ${{ github.run_id }}-${{ inputs.board_id }}-logs
104114
path: armbian/output
105115
- name: upload image to artifact store
116+
if: "${{ inputs.test_image_url == '' }}"
106117
uses: actions/upload-artifact@v4
107118
with:
108119
name: ${{ github.run_id }}-${{ inputs.board_id }}-image
@@ -135,15 +146,24 @@ jobs:
135146
with:
136147
ref: "${{ env.VERSION }}"
137148
- uses: actions/download-artifact@v4
149+
if: "${{ inputs.test_image_url == '' }}"
138150
with:
139151
name: ${{ env.ARTIFACT_ID }}
140152
path: output
153+
- name: Download Test Image
154+
if: "${{ inputs.test_image_url != '' }}"
155+
run: |
156+
set -ex
157+
mkdir -p output
158+
wget -nv "${{ inputs.test_image_url }}" | pv -i 3 > "output/${ARTIFACT_FILE?}"
141159
- name: Prepare test
142160
run: |
143161
set -x
144162
mv output/${ARTIFACT_FILE?} ncp.img
145163
sudo apt-get install -y systemd-container
146-
sudo pip install selenium
164+
python3 -m venv ./.venv
165+
. ./.venv/bin/activate
166+
./.venv/bin/pip install selenium
147167
sudo rm -rf raspbian_root
148168
. ./build/buildlib.sh
149169
mount_raspbian "ncp.img"
@@ -175,7 +195,7 @@ jobs:
175195
sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" &
176196
sleep 60
177197
178-
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
198+
CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait)
179199
180200
success=false
181201
for attempt in {1..30}
@@ -234,7 +254,7 @@ jobs:
234254
for attempt in {1..5}
235255
do
236256
echo -e "${LOG_CICD} == Activation Tests (attempt $attempt/5) =="
237-
python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
257+
./.venv/bin/python tests/activation_tests.py -t 300 --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
238258
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
239259
echo -e "${LOG_CICD} Activation test failed!"
240260
echo -e "${LOG_DIAG} Geckodriver logs:"
@@ -258,7 +278,7 @@ jobs:
258278
for attempt in {1..5}
259279
do
260280
echo -e "${LOG_CICD} == System Tests (attempt $attempt/5) =="
261-
sudo python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
281+
USE_SUDO=yes ./.venv/bin/python tests/system_tests.py --non-interactive |& awk "{ print \"${LOG_TEST} \" \$0 }"
262282
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
263283
echo -e "${LOG_CICD} System test failed!"
264284
sleep 12
@@ -276,7 +296,7 @@ jobs:
276296
for attempt in {1..5}
277297
do
278298
echo -e "${LOG_CICD} == Nextcloud Tests (attempt $attempt/5) =="
279-
python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
299+
./.venv/bin/python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }"
280300
[[ ${PIPESTATUS[0]} -eq 0 ]] || {
281301
echo -e "${LOG_CICD} Nextcloud test failed!"
282302
echo -e "${LOG_DIAG} /etc/os-release:"
@@ -336,7 +356,7 @@ jobs:
336356
}
337357
338358
# test-distupgrade:
339-
# runs-on: ubuntu-20.04
359+
# runs-on: ubuntu-latest
340360
# env:
341361
# VERSION: "${{ inputs.git_ref || github.ref }}"
342362
# LOG_GUEST: "\\033[1;34mGUEST::\\033[0m"

0 commit comments

Comments
 (0)