Compare commits

...

1 Commits

Author SHA1 Message Date
Julius Härtl
3c9d2e09a7 chore: Use postgres for cypress
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-05-09 09:55:04 +02:00

View File

@@ -14,7 +14,7 @@ env:
jobs:
cypress:
runs-on: ubuntu-latest
runs-on: ['ubuntu-latest', 'self-hosted']
strategy:
fail-fast: false
@@ -22,9 +22,19 @@ jobs:
node-version: [20.x]
# containers: [1, 2, 3]
php-versions: [ '8.1' ]
databases: [ 'sqlite' ]
server-versions: [ 'master' ]
services:
postgres:
image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest
ports:
- 4444:5432/tcp
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpassword
POSTGRES_DB: nextcloud
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2
@@ -76,9 +86,9 @@ jobs:
PHP_CLI_SERVER_WORKERS: 10
run: |
mkdir data
php 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 admin
php occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
php occ config:system:set debug --value=true --type=boolean
echo '<?php $CONFIG=["memcache.local"=>"\OC\Memcache\APCu","hashing_default_password"=>true];' > config/config.php
php occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php occ background:cron
php -f index.php
php -S 0.0.0.0:8081 &
export OC_PASS=1234561
@@ -90,20 +100,19 @@ jobs:
composer install --no-dev
npm ci
npm run build
cd ../../
curl -v http://localhost:8081/index.php/login
- name: Cypress run
uses: cypress-io/github-action@v6
with:
record: false
parallel: false
wait-on: '${{ env.CYPRESS_baseUrl }}'
working-directory: 'apps/${{ env.APP_NAME }}'
config: defaultCommandTimeout=10000,video=false
- name: Run E2E cypress tests
run: |
cd 'apps/${{ env.APP_NAME }}'
npx wait-on $CYPRESS_baseUrl
npx cypress run --record false --config defaultCommandTimeout=10000,video=false
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
npm_package_name: ${{ env.APP_NAME }}
# https://github.com/cypress-io/github-action/issues/124
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
npm_package_name: ${{ env.APP_NAME }}
- name: Upload test failure screenshots
uses: actions/upload-artifact@v4