12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- name: SFTP unit tests
- on:
- pull_request:
- paths:
- - 'apps/files_external/**'
- env:
- APP_NAME: files_external
- concurrency:
- group: sftp-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
- 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- 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@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
- with:
- php-version: ${{ matrix.php-versions }}
- extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Set up Nextcloud
- run: |
- composer install
- 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
- composer run test:files_external 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-low
- needs: sftp-tests
- if: always()
- steps:
- - name: Summary status
- run: if ${{ needs.sftp-tests.result != 'success' }}; then exit 1; fi
|