Skip to content

Commit 6b79eea

Browse files
committed
chore(CI): Migrate samba files_external tests from Drone to GitHub
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent be6e7e3 commit 6b79eea

2 files changed

Lines changed: 108 additions & 40 deletions

File tree

.drone.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -145,46 +145,6 @@ trigger:
145145
- pull_request
146146
- push
147147

148-
---
149-
kind: pipeline
150-
name: samba
151-
152-
steps:
153-
- name: submodules
154-
image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest
155-
commands:
156-
- git submodule update --init
157-
- name: sqlite-php8.0-samba-native
158-
image: ghcr.io/nextcloud/continuous-integration-samba-native-php8.0:latest
159-
commands:
160-
- smbd -D -FS &
161-
- ./autotest-external.sh sqlite smb-linux
162-
- wget https://codecov.io/bash -O codecov.sh
163-
- 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"
164-
- 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"
165-
- 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-smb-linux.xml; fi"
166-
- 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-smb-linux.xml; fi"
167-
# Temporarily disabled because it times out for unknown reasons 98% of the time
168-
#- name: sqlite-php8.0-samba-non-native
169-
# image: ghcr.io/nextcloud/continuous-integration-samba-non-native-php8.0:latest
170-
# commands:
171-
# - smbd -D -FS &
172-
# - ./autotest-external.sh sqlite smb-linux
173-
# - wget https://codecov.io/bash -O codecov.sh
174-
# - 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"
175-
# - 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"
176-
# - 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-smb-linux.xml; fi"
177-
# - 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-smb-linux.xml; fi"
178-
179-
trigger:
180-
branch:
181-
- master
182-
- stable*
183-
event:
184-
- pull_request
185-
- push
186-
187-
188148
---
189149
kind: signature
190150
hmac: a4f9a3fec27fbd14dfb478902b7b5cbc155916a309f05fe6eb78961b3db18c3a
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: PHPUnit files_external SMB
2+
on:
3+
pull_request:
4+
schedule:
5+
- cron: "5 2 * * *"
6+
7+
concurrency:
8+
group: files-external-smb-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
changes:
13+
runs-on: ubuntu-latest-low
14+
15+
outputs:
16+
src: ${{ steps.changes.outputs.src}}
17+
18+
steps:
19+
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
20+
id: changes
21+
continue-on-error: true
22+
with:
23+
filters: |
24+
src:
25+
- '.github/workflows/**'
26+
- '3rdparty/**'
27+
- 'apps/files_external/**'
28+
- 'vendor/**'
29+
- 'vendor-bin/**'
30+
- 'composer.json'
31+
- 'composer.lock'
32+
- '**.php'
33+
34+
files-external-smb:
35+
runs-on: ubuntu-latest
36+
needs: changes
37+
38+
if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
39+
40+
strategy:
41+
matrix:
42+
php-versions: ['8.0', '8.3']
43+
include:
44+
- php-versions: '8.0'
45+
coverage: ${{ github.event_name != 'pull_request' }}
46+
47+
name: php${{ matrix.php-versions }}-smb
48+
49+
services:
50+
samba:
51+
image: silvershell/samba #ghcr.io/nextcloud/continuous-integration-samba:latest
52+
ports:
53+
- 445:445
54+
55+
steps:
56+
- name: Checkout server
57+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
58+
with:
59+
submodules: true
60+
61+
- name: Set up php ${{ matrix.php-versions }}
62+
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
63+
with:
64+
php-version: ${{ matrix.php-versions }}
65+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
66+
extensions: ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, smbclient, sqlite, pdo_sqlite
67+
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
68+
ini-file: development
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Set up smbclient
73+
# This is needed as icewind/smb php library for notify
74+
run: sudo apt-get install -y smbclient
75+
76+
- name: Set up Nextcloud
77+
run: |
78+
composer install
79+
./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
80+
./occ config:system:set --value true --type boolean allow_local_remote_servers
81+
./occ app:enable --force files_external
82+
echo "<?php return ['run'=>true, 'host'=>'localhost', 'user'=>'test', 'password'=>'test', 'root'=>'', 'share'=>'public'];" > apps/files_external/tests/config.smb.php
83+
84+
- name: Wait for smb
85+
run: |
86+
apps/files_external/tests/env/wait-for-connection 127.0.0.1 445 60
87+
88+
- name: PHPUnit
89+
run: composer run test:files_external -- --verbose \
90+
apps/files_external/tests/Storage/SmbTest.php \
91+
${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
92+
93+
- name: Upload code coverage
94+
if: ${{ !cancelled() && matrix.coverage }}
95+
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
96+
with:
97+
files: ./clover.xml
98+
flags: phpunit-files-external-smb
99+
100+
files-external-smb-summary:
101+
runs-on: ubuntu-latest-low
102+
needs: [changes, files-external-smb]
103+
104+
if: always()
105+
106+
steps:
107+
- name: Summary status
108+
run: if ${{ needs.changes.outputs.src != 'false' && needs.files-external-smb.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)