[3.3] fix: improve query for finding unscanned files #279
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ICAP | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- stable* | |
env: | |
APP_NAME: files_antivirus | |
jobs: | |
clam: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['7.4'] | |
databases: ['sqlite'] | |
server-versions: [ 'stable24' ] | |
name: icap-clmav | |
services: | |
clam: | |
image: deepdiver/icap-clamav-service | |
ports: | |
- 1344:1344 | |
steps: | |
- name: Checkout server | |
uses: actions/checkout@v2 | |
with: | |
repository: nextcloud/server | |
ref: ${{ matrix.server-versions }} | |
- name: Checkout submodules | |
shell: bash | |
run: | | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | |
- name: Checkout app | |
uses: actions/checkout@v2 | |
with: | |
path: apps/${{ env.APP_NAME }} | |
- name: Set up php ${{ matrix.php-versions }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: phpunit | |
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | |
- name: Set up PHPUnit | |
working-directory: apps/${{ env.APP_NAME }} | |
run: | | |
rm composer.lock | |
composer i | |
- name: Set up Nextcloud | |
env: | |
DB_PORT: 4444 | |
run: | | |
mkdir data | |
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password | |
./occ app:enable --force ${{ env.APP_NAME }} | |
./occ config:system:set allow_local_remote_servers --type boolean --value true | |
- name: PHPUnit | |
working-directory: apps/${{ env.APP_NAME }} | |
env: | |
ICAP_HOST: localhost | |
ICAP_PORT: 1344 | |
ICAP_REQUEST: avscan | |
ICAP_HEADER: X-Infection-Found | |
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml tests/Scanner/ICAPTest.php | |
kaspersky: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['7.4'] | |
databases: ['sqlite'] | |
server-versions: [ 'stable24' ] | |
name: icap-kaspersky | |
services: | |
kaspersky: | |
image: ghcr.io/icewind1991/kaspersky-cap:latest | |
credentials: | |
username: icewind1991 | |
password: ${{ secrets.ghcr_password }} | |
ports: | |
- 1344:1344 | |
steps: | |
- name: Checkout server | |
uses: actions/checkout@v2 | |
with: | |
repository: nextcloud/server | |
ref: ${{ matrix.server-versions }} | |
- name: Checkout submodules | |
shell: bash | |
run: | | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | |
- name: Checkout app | |
uses: actions/checkout@v2 | |
with: | |
path: apps/${{ env.APP_NAME }} | |
- name: Set up php ${{ matrix.php-versions }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: phpunit | |
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd | |
- name: Set up PHPUnit | |
working-directory: apps/${{ env.APP_NAME }} | |
run: composer i | |
- name: Set up Nextcloud | |
env: | |
DB_PORT: 4444 | |
run: | | |
mkdir data | |
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password | |
./occ app:enable --force ${{ env.APP_NAME }} | |
./occ config:system:set allow_local_remote_servers --type boolean --value true | |
- name: PHPUnit | |
working-directory: apps/${{ env.APP_NAME }} | |
env: | |
ICAP_HOST: localhost | |
ICAP_PORT: 1344 | |
ICAP_REQUEST: req | |
ICAP_HEADER: X-Virus-ID | |
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml tests/Scanner/ICAPTest.php |