807353cbe4
RepositoryImportSource::copyToFolder() called putContent() on the generic return type of Node::get(), which doesn't declare that method -- only File does. Existing-file overwrite during a per-user restore would have fatally errored at runtime; added an instanceof check and a resource leak fix (finally-close) while there. Also guarded getFileAsStream() against fopen() returning false. Everything else Psalm (strict level) currently flags is mechanical (missing `final` on leaf classes -- applied everywhere safe) or pre-existing array-shape/type gaps, captured in psalm-baseline.xml so CI fails only on new issues from here on, not the whole backlog at once.
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
# SPDX-FileCopyrightText: 2026 Dillard Blom
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
unit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: ['8.2', '8.3', '8.4']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: sodium, zip
|
|
coverage: none
|
|
- run: composer install --no-interaction --no-progress
|
|
- run: vendor/bin/phpunit -c tests/phpunit.xml
|
|
|
|
psalm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.2'
|
|
extensions: sodium, zip
|
|
coverage: none
|
|
- run: composer install --no-interaction --no-progress
|
|
- run: composer psalm
|
|
|
|
integration:
|
|
# Full round trip (key, kit, location, backup, incremental, restore modes, database dump and
|
|
# restore, retention, trash) on a fresh Nextcloud per version and database.
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
nextcloud: ['32', '33', '34', '35']
|
|
database: ['sqlite', 'mariadb', 'pgsql']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Round trip on Nextcloud ${{ matrix.nextcloud }} / ${{ matrix.database }}
|
|
run: tests/integration/matrix.sh "${{ matrix.nextcloud }}" "${{ matrix.database }}"
|
|
|
|
integration-targets:
|
|
# Same round trip, but through the real S3 (s3mock) and SFTP backends instead of a local
|
|
# path, so files_external's AmazonS3/SFTP backend and auth classes are actually exercised.
|
|
# Backend correctness does not depend on the Nextcloud version or database, so this runs once.
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Round trip against S3 and SFTP
|
|
run: tests/integration/targets-matrix.sh
|