Skip to content

Commit

Permalink
fix(tests): Update phpunit workflow to fix OCI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Sep 29, 2023
1 parent c26470b commit 0ca71be
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,17 @@ jobs:
services:
oracle:
image: ghcr.io/gvenzl/oracle-xe:11
ports:
- 4444:1521/tcp

# Provide passwords and other environment variables to container
env:
ORACLE_RANDOM_PASSWORD: true
APP_USER: autotest
APP_USER_PASSWORD: owncloud
APP_USER_PASSWORD: nextcloud

# Forward Oracle port
ports:
- 1521:1521/tcp

# Provide healthcheck script options for startup
options: >-
--health-cmd healthcheck.sh
Expand All @@ -273,24 +277,27 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: "shivammathur/setup-php@v2"
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, oci8, zip, gd
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
DB_PORT: 1521
OC_PASS: test
run: |
mkdir data
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=nextcloud --admin-user admin --admin-pass admin
./occ user:add --password-from-env --display-name="Test Displayname" test
./occ user:add --password-from-env --display-name="User No. 1" user1
./occ app:enable --force ${{ env.APP_NAME }}
Expand Down

0 comments on commit 0ca71be

Please sign in to comment.