Skip to content

enh: Sync 3s after startup #1538

enh: Sync 3s after startup

enh: Sync 3s after startup #1538

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- master
- develop
env:
APP_NAME: bookmarks
jobs:
php:
runs-on: ubuntu-latest
env:
SELENIUM_HUB_HOST: hub
TEST_HOST: nextcloud
SERVER_BRANCH: ${{ matrix.server-version }}
NC_APP_VERSION: ${{ matrix.app-version }}
SELENIUM_VERSION: 3
MYSQL_PASSWORD: root
strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
node-version: [14.x]
npm-version: [7.x]
server-version: ['26']
app-version: ['stable']
selenium-version: ['3']
floccus-adapter:
- fake
- nextcloud-bookmarks
- nextcloud-bookmarks-old
- webdav-xbel
- webdav-html
- webdav-html-encrypted
- webdav-xbel-encrypted
- google-drive
- google-drive-encrypted
test-name:
- test
- benchmark root
browsers: ['firefox']
include:
- app-version: stable12
server-version: 25
floccus-adapter: nextcloud-bookmarks
test-name: test
browsers: firefox
node-version: 14.x
npm-version: 7.x
- app-version: master
server-version: 26
floccus-adapter: nextcloud-bookmarks
test-name: test
browsers: firefox
node-version: 14.x
npm-version: 7.x
- app-version: master
server-version: 26
floccus-adapter: nextcloud-bookmarks
test-name: benchmark root
browsers: firefox
node-version: 14.x
npm-version: 7.x
- app-version: master
server-version: 26
floccus-adapter: nextcloud-bookmarks-old
test-name: benchmark root
browsers: firefox
node-version: 14.x
npm-version: 7.x
- app-version: stable
server-version: 26
floccus-adapter: fake-noCache
test-name: test
browsers: firefox
node-version: 14.x
npm-version: 7.x
name: ${{matrix.floccus-adapter}}:${{ matrix.test-name}} nc@${{ matrix.server-version }} bm@${{ matrix.app-version }} ${{ matrix.browsers }}
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"
chrome:
image: selenium/node-chrome:3
env:
HUB_HOST: hub
HUB_PORT: 4444
options: --shm-size="2g"
nextcloud:
image: nextcloud:${{ matrix.server-version }}
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/floccus/floccus/apps:/var/www/html/custom_apps
options: --name nextcloud
mysql:
image: mariadb:10.5 # see https://github.com/nextcloud/docker/issues/1536
env:
MYSQL_ROOT_PASSWORD: ${{env.MYSQL_PASSWORD}}
steps:
- name: Checkout floccus
uses: actions/checkout@v2
with:
path: floccus
- name: Checkout bookmarks app
uses: actions/checkout@v2
with:
repository: nextcloud/${{ env.APP_NAME }}
ref: ${{ matrix.app-version }}
path: ${{ env.APP_NAME }}
if: matrix.floccus-adapter == 'nextcloud-bookmarks' || matrix.floccus-adapter == 'nextcloud-bookmarks-old'
- name: Install bookmarks app
shell: bash
run: |
cd ${{ env.APP_NAME }}
composer install --ignore-platform-req=php --no-dev
if: matrix.floccus-adapter == 'nextcloud-bookmarks' || matrix.floccus-adapter == 'nextcloud-bookmarks-old'
- 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' || matrix.floccus-adapter == 'nextcloud-bookmarks-old'
- name: Enable APCu
run: |
NEXT_WAIT_TIME=0
until [ $NEXT_WAIT_TIME -eq 25 ] || docker exec --user www-data nextcloud php occ config:system:set --value "\\OC\\Memcache\\APCu" memcache.local; do
sleep $(( NEXT_WAIT_TIME++ ))
done
[ $NEXT_WAIT_TIME -lt 25 ]
if: matrix.floccus-adapter != 'fake'
- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up npm ${{ matrix.npm-version }}
run: npm i -g npm@"${{ matrix.npm-version }}"
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- 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: ${{ secrets.GIST_TOKEN }}
GOOGLE_API_REFRESH_TOKEN: ${{ secrets.GOOGLE_API_REFRESH_TOKEN }}
APP_VERSION: ${{ matrix.app-version }}
run: |
npm run test