bookmarks/.github/workflows/floccus.yml

141 lines
3.7 KiB
YAML

name: Floccus
on:
pull_request:
push:
branches:
- master
- stable*
env:
APP_NAME: bookmarks
permissions:
contents: read
jobs:
php:
runs-on: ubuntu-latest
env:
SELENIUM_HUB_HOST: hub
TEST_HOST: nextcloud
SERVER_BRANCH: ${{ matrix.server-versions }}
SELENIUM_VERSION: 3
MYSQL_PASSWORD: root
strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
floccus-ref: ['master', 'develop']
node-versions: [14.x]
npm-versions: [7.x]
server-versions: ['24']
selenium-version: ['3']
floccus-adapter:
- nextcloud-bookmarks
test-name:
- 'test'
- 'benchmark root'
browsers: ['firefox']
name: floccus@${{matrix.floccus-ref}} ${{matrix.floccus-adapter}}:${{ matrix.test-name}} ${{matrix.browsers}} nc@${{matrix.server-versions}}
services:
hub:
image: selenium/hub:3
ports:
- 4444:4444
firefox:
image: selenium/node-firefox:3
env:
HUB_HOST: hub
HUB_PORT: 4444
options: --shm-size="2g"
nextcloud:
image: nextcloud:${{ matrix.server-versions }}
env:
NEXTCLOUD_ADMIN_USER: admin
NEXTCLOUD_ADMIN_PASSWORD: admin
MYSQL_DATABASE: nextcloud
MYSQL_USER: root
MYSQL_PASSWORD: ${{env.MYSQL_PASSWORD}}
MYSQL_HOST: mysql
NEXTCLOUD_TRUSTED_DOMAINS: nextcloud
volumes:
- /home/runner/work/bookmarks/bookmarks/apps:/var/www/html/custom_apps
options: --name nextcloud
mysql:
image: mariadb:10.5
env:
MYSQL_ROOT_PASSWORD: ${{env.MYSQL_PASSWORD}}
steps:
- name: Checkout floccus
uses: actions/checkout@v2
with:
repository: marcelklehr/floccus
ref: ${{matrix.floccus-ref}}
path: floccus
- name: Checkout bookmarks app
uses: actions/checkout@v2
with:
path: ${{ env.APP_NAME }}
if: matrix.floccus-adapter == 'nextcloud-bookmarks'
- name: Install bookmarks app
shell: bash
run: |
cd ${{ env.APP_NAME }}
composer install --ignore-platform-req=php
if: matrix.floccus-adapter == 'nextcloud-bookmarks'
- name: Enable bookmarks app
shell: bash
run: |
sudo cp -R ${{ env.APP_NAME }} apps/
NEXT_WAIT_TIME=0
until [ $NEXT_WAIT_TIME -eq 25 ] || docker exec --user www-data nextcloud php occ app:enable ${{ env.APP_NAME }}; do
sleep $(( NEXT_WAIT_TIME++ ))
done
[ $NEXT_WAIT_TIME -lt 25 ]
if: matrix.floccus-adapter == 'nextcloud-bookmarks'
- name: List apps
shell: bash
run: |
docker exec --user www-data nextcloud php occ app:list
- name: Enable APCu
run: |
docker exec --user www-data nextcloud php occ config:system:set --value "\\OC\\Memcache\\APCu" memcache.local
if: matrix.floccus-adapter != 'fake'
- name: Set up node ${{ matrix.node-versions }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-versions }}
- name: Install npm
shell: bash
run: |
npm install -g npm@${{ matrix.npm-versions }}
- name: Install dependencies & build
working-directory: floccus
run: |
npm ci
npm run build-release --if-present
- name: Run tests
working-directory: floccus
env:
SELENIUM_BROWSER: ${{ matrix.browsers }}
FLOCCUS_TEST: ${{matrix.floccus-adapter}} ${{ matrix.test-name}}
GIST_TOKEN: "foo"
run: |
npm run test