You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.7 KiB
112 lines
3.7 KiB
name: Behat Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'appinfo/**'
|
|
- 'lib/**'
|
|
- 'tests/integration/behat/**'
|
|
- 'tests/assets/**'
|
|
- 'composer.json'
|
|
- 'composer.lock'
|
|
- 'vendor-bin/behat/**'
|
|
- '.github/workflows/behat.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
BEHAT_BASE_URL: http://localhost:8080
|
|
ONLYOFFICE_DOCUMENT_SERVER_URL: http://onlyoffice/
|
|
ONLYOFFICE_DOCUMENT_SERVER_INTERNAL_URL: http://onlyoffice/
|
|
ONLYOFFICE_SECRET: secret
|
|
|
|
jobs:
|
|
matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
php-min: ${{ steps.versions.outputs.php-min }}
|
|
branches-min: ${{ steps.versions.outputs.branches-min }}
|
|
steps:
|
|
- name: Checkout app
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Get version matrix
|
|
id: versions
|
|
uses: icewind1991/nextcloud-version-matrix@v1.3.2
|
|
|
|
behat:
|
|
runs-on: ubuntu-latest
|
|
needs: matrix
|
|
container: node:24
|
|
|
|
services:
|
|
onlyoffice:
|
|
image: onlyoffice/documentserver
|
|
env:
|
|
JWT_SECRET: secret
|
|
JWT_HEADER: Authorization
|
|
JWT_ENABLED: true
|
|
options: >-
|
|
--health-cmd "curl -sf http://localhost/healthcheck | grep -q 'true'"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 30
|
|
|
|
mysql:
|
|
image: mysql:8.4
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: rootpassword
|
|
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10
|
|
|
|
steps:
|
|
- name: Set up Nextcloud env
|
|
uses: ChristophWurst/setup-nextcloud@v0.4.2
|
|
with:
|
|
nextcloud-version: ${{ needs.matrix.outputs.branches-min }}
|
|
php-version: ${{ needs.matrix.outputs.php-min }}
|
|
node-version: false
|
|
|
|
- name: Checkout onlyoffice
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
submodules: true
|
|
path: nextcloud/apps/onlyoffice
|
|
|
|
- name: Install composer dependencies
|
|
working-directory: nextcloud/apps/onlyoffice
|
|
run: |
|
|
composer install
|
|
composer bin behat install
|
|
|
|
- name: Set up and configure Nextcloud
|
|
working-directory: nextcloud
|
|
run: |
|
|
mkdir data
|
|
php occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=mysql --database-port=3306 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
|
php -f index.php
|
|
PHP_CLI_SERVER_WORKERS=20 php -S 0.0.0.0:8080 &
|
|
CONTAINER_IP=$(hostname -I | awk '{print $1}')
|
|
echo "ONLYOFFICE_STORAGE_URL=http://$CONTAINER_IP:8080/" >> $GITHUB_ENV
|
|
php occ config:system:set force_language --value en
|
|
php occ app:install spreed
|
|
php occ app:enable --force onlyoffice
|
|
php occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
|
|
php occ config:system:set ratelimit.protection.enabled --value false --type bool
|
|
php occ config:system:set trusted_domains 1 --value="$CONTAINER_IP"
|
|
php occ config:app:set onlyoffice DocumentServerUrl --value="${{ env.ONLYOFFICE_DOCUMENT_SERVER_URL }}"
|
|
php occ config:app:set onlyoffice jwt_secret --value="${{ env.ONLYOFFICE_SECRET }}"
|
|
php occ config:app:set onlyoffice StorageUrl --value="http://$CONTAINER_IP:8080/"
|
|
php occ config:system:set allow_local_remote_servers --value true --type bool
|
|
|
|
php occ app:list
|
|
php occ onlyoffice:documentserver --check
|
|
|
|
- name: Run tests
|
|
working-directory: nextcloud/apps/onlyoffice
|
|
run: composer run test:integration
|
|
|