chore(ci): Migrate files-external webdav tests to GitHub

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/43220/head
Ferdinand Thiessen 4 months ago
parent 50fffa8d95
commit f9ed795608

@ -184,37 +184,6 @@ 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

@ -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.3'
coverage: true
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

@ -1,26 +0,0 @@
#!/usr/bin/env bash
#
# Nextcloud
#
# retrieve current folder to place the config in the parent folder
thisFolder=`echo $0 | sed 's#env/start-webdav-apachedrone\.sh##'`
if [ -z "$thisFolder" ]; then
thisFolder="."
fi;
cat > $thisFolder/config.webdav.php <<DELIM
<?php
return array(
'run'=>true,
'host'=>'127.0.0.1:80/webdav/',
'user'=>'test',
'password'=>'pass',
'root'=>'',
'wait'=> 0
);
DELIM

@ -1,14 +0,0 @@
#!/usr/bin/env bash
#
# Nextcloud
# retrieve current folder to remove the config from the parent folder
thisFolder=`echo $0 | sed 's#env/stop-webdav-apachedrone\.sh##'`
if [ -z "$thisFolder" ]; then
thisFolder="."
fi;
# cleanup
rm $thisFolder/config.webdav.php
Loading…
Cancel
Save