Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 1 addition & 32 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,38 +184,7 @@ trigger:
- pull_request
- push

---
kind: pipeline
name: sqlite-php8.0-webdav-apache

steps:
- name: submodules
image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest
commands:
- git submodule update --init
- name: sqlite-php8.0-webdav-apache
image: ghcr.io/nextcloud/continuous-integration-webdav-apache-php8.0:latest
commands:
- apache2ctl start
- ./autotest-external.sh sqlite webdav-apachedrone
- wget https://codecov.io/bash -O codecov.sh
- sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
- sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
- sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-webdav-apachedrone.xml; fi"
- sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-webdav-apachedrone.xml; fi"

services:
- name: cache
image: ghcr.io/nextcloud/continuous-integration-redis:latest

trigger:
branch:
- master
- stable*
event:
- pull_request
- push

---
kind: signature
hmac: c0e95a282303de842a645a780b391964eb839e4cb11446e4cc9a19ef1a661383
hmac: a4f9a3fec27fbd14dfb478902b7b5cbc155916a309f05fe6eb78961b3db18c3a
4 changes: 2 additions & 2 deletions .github/workflows/files-external-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
include:
- php-versions: '8.3'
coverage: true
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

name: php${{ matrix.php-versions }}-s3

Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/files-external-webdav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: PHPUnit files_external WebDAV
on:
pull_request:
schedule:
- cron: "5 2 * * *"

concurrency:
group: files-external-webdav-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- '3rdparty/**'
- 'apps/files_external/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'
- '**.php'

files-external-webdav-apache:
runs-on: ubuntu-latest
needs: changes

if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}

strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

name: php${{ matrix.php-versions }}-webdav

services:
apache:
image: ghcr.io/nextcloud/continuous-integration-webdav-apache:latest
ports:
- 8081:80

steps:
- name: Checkout server
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: true

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Nextcloud
run: |
composer install
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
./occ config:system:set --value true --type boolean allow_local_remote_servers
./occ app:enable --force files_external
echo "<?php return ['run' => true, 'host' => 'localhost:8081/webdav/', 'user' => 'test', 'password'=>'pass', 'root' => '', 'wait' => 0];" > apps/files_external/tests/config.webdav.php

- name: Wait for WebDAV
run: |
sleep 5
curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://test:pass@localhost:8081/webdav/

- name: PHPUnit
run: composer run test:files_external -- --verbose \
apps/files_external/tests/Storage/WebdavTest.php \
${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
with:
files: ./clover.xml
flags: phpunit-files-external-webdav

files-external-webdav-summary:
runs-on: ubuntu-latest
needs: [changes, files-external-webdav-apache]

if: always()

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.files-external-webdav-apache.result != 'success' }}; then exit 1; fi
8 changes: 4 additions & 4 deletions apps/files_external/tests/env/start-webdav-apache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fi

echo "Docker executable found - setup docker"

echo "Fetch recent morrisjobke/webdav docker image"
docker pull morrisjobke/webdav
echo "Fetch recent webdav docker image"
docker pull ghcr.io/nextcloud/continuous-integration-webdav-apache:latest

# retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | sed 's#env/start-webdav-apache\.sh##'`
Expand All @@ -45,7 +45,7 @@ if [ -n "$RUN_DOCKER_MYSQL" ]; then
parameter="--link $containerName:db"
fi

container=`docker run -P $parameter -d -e USERNAME=test -e PASSWORD=test morrisjobke/webdav`
container=`docker run -P $parameter -d --rm ghcr.io/nextcloud/continuous-integration-webdav-apache:latest`
host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container`

echo -n "Waiting for Apache initialization on ${host}:${port}"
Expand All @@ -64,7 +64,7 @@ return array(
'run'=>true,
'host'=>'${host}:80/webdav/',
'user'=>'test',
'password'=>'test',
'password'=>'pass',
'root'=>'',
// wait delay in seconds after write operations
// (only in tests)
Expand Down
26 changes: 0 additions & 26 deletions apps/files_external/tests/env/start-webdav-apachedrone.sh

This file was deleted.

14 changes: 0 additions & 14 deletions apps/files_external/tests/env/stop-webdav-apachedrone.sh

This file was deleted.

9 changes: 7 additions & 2 deletions autotest-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ function print_syntax {
}

if ! [ -x "$PHPUNIT" ]; then
echo "phpunit executable not found, please install phpunit version >= 4.8" >&2
exit 3
echo "phpunit executable not found, trying local one from build/integration" >&2
if [ -x "$PWD/build/integration/vendor/phpunit/phpunit/phpunit" ]; then
PHPUNIT="$PWD/build/integration/vendor/phpunit/phpunit/phpunit"
else
echo "phpunit executable not found, please install phpunit version >= 9.0" >&2
exit 3
fi
fi

PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2)
Expand Down