diff options
author | Robin Appelman <robin@icewind.nl> | 2023-09-20 10:08:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 10:08:02 +0200 |
commit | 2be08904ed8d103deb23ccc8b6b331a2e0e2c78d (patch) | |
tree | 87bcf8ff39696d925652622032a4dd32e84aee95 /.github | |
parent | 1fe62e186287fe710ad6e208e08a55f8526117e0 (diff) | |
parent | 0a5ebef4250932e0607366686be4f524519ed656 (diff) | |
download | nextcloud-server-2be08904ed8d103deb23ccc8b6b331a2e0e2c78d.tar.gz nextcloud-server-2be08904ed8d103deb23ccc8b6b331a2e0e2c78d.zip |
Merge pull request #40487 from nextcloud/backport/40183/stable27
[stable27] SFTP improvements
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/sftp.yml | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/.github/workflows/sftp.yml b/.github/workflows/sftp.yml new file mode 100644 index 00000000000..939372a53d2 --- /dev/null +++ b/.github/workflows/sftp.yml @@ -0,0 +1,75 @@ +name: SFTP unit tests +on: + push: + branches: + - master + - stable* + paths: + - 'apps/files_external/**' + pull_request: + paths: + - 'apps/files_external/**' + +env: + APP_NAME: files_external + +jobs: + sftp-tests: + runs-on: ubuntu-latest + + if: ${{ github.repository_owner != 'nextcloud-gmbh' }} + + strategy: + # do not stop on another job's failure + fail-fast: false + matrix: + php-versions: ['8.0'] + sftpd: ['openssh'] + + name: php${{ matrix.php-versions }}-${{ matrix.sftpd }} + + steps: + - name: Checkout server + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up sftpd + run: | + sudo mkdir /tmp/sftp + sudo chown -R 0777 /tmp/sftp + if [[ "${{ matrix.sftpd }}" == 'openssh' ]]; then docker run -p 2222:22 --name sftp -d -v /tmp/sftp:/home/test atmoz/sftp "test:test:::data"; fi + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit:9 + extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Nextcloud + run: | + mkdir data + ./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 app:enable --force ${{ env.APP_NAME }} + php -S localhost:8080 & + - name: PHPUnit + run: | + echo "<?php return ['run' => true, 'host' => 'localhost:2222','user' => 'test','password' => 'test', 'root' => 'data'];" > apps/${{ env.APP_NAME }}/tests/config.sftp.php + phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/SftpTest.php + - name: sftpd logs + if: always() + run: | + ls -l /tmp/sftp + docker logs sftp + + sftp-summary: + runs-on: ubuntu-latest + needs: sftp-tests + + if: always() + + steps: + - name: Summary status + run: if ${{ needs.sftp-tests.result != 'success' }}; then exit 1; fi |