diff options
author | Jonas <jonas@freesources.org> | 2022-02-08 15:49:31 +0300 |
---|---|---|
committer | Jonas <jonas@freesources.org> | 2022-02-08 17:00:01 +0300 |
commit | 809226b4e967636977756c3af35ec2fbb9c4146b (patch) | |
tree | 6617c1168f036dcc52fe1c7efc9081f9976d0b65 /.github | |
parent | b73651e1060da43b8f3d9db154530c6ade1da123 (diff) |
Migrate phpunit tests from drone to github actions (Fixes: #1679)
Only test with sqlite and oc for now. There's no added value to run our
basic phpunit test on mysql and postgresql environments.
Also drops the obsolete `occ app:check-code` compatibility tests.
Signed-off-by: Jonas <jonas@freesources.org>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/phpunit.yml (renamed from .github/workflows/oci.yml) | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/.github/workflows/oci.yml b/.github/workflows/phpunit.yml index 18a75d9c0..7d0905bfb 100644 --- a/.github/workflows/oci.yml +++ b/.github/workflows/phpunit.yml @@ -2,10 +2,6 @@ name: PHPUnit on: pull_request: - paths: - - 'appinfo/**' - - 'lib/**' - - 'tests/**' push: branches: - master @@ -15,6 +11,43 @@ env: APP_NAME: text jobs: + php: + runs-on: ubuntu-latest + + strategy: + # do not stop on another job's failure + fail-fast: false + matrix: + php-versions: ['7.4', '8.0'] + databases: ['sqlite'] + server-versions: ['master'] + + name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + steps: + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@v2 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip + + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer i + oci: runs-on: ubuntu-latest @@ -22,7 +55,7 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.4'] + php-versions: ['7.4', '8.0'] databases: ['oci'] server-versions: ['master'] @@ -40,13 +73,7 @@ jobs: with: repository: nextcloud/server ref: ${{ matrix.server-versions }} - - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + submodules: true - name: Checkout app uses: actions/checkout@v2 @@ -54,11 +81,11 @@ jobs: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: "shivammathur/setup-php@v2" + uses: shivammathur/setup-php@v2 with: - php-version: "${{ matrix.php-versions }}" + php-version: ${{ matrix.php-versions }} + tools: phpunit extensions: mbstring, iconv, fileinfo, intl, oci8 - tools: phpunit:8.5.2 coverage: none - name: Set up PHPUnit @@ -69,10 +96,8 @@ jobs: run: | mkdir data ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin - php -f index.php ./occ app:enable --force ${{ env.APP_NAME }} - name: PHPUnit - working-directory: apps/${{ env.APP_NAME }}/tests - run: phpunit -c phpunit.xml - + working-directory: apps/${{ env.APP_NAME }} + run: phpunit -c tests/phpunit.xml |