-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
- Loading branch information
1 parent
7ffc168
commit 370cfd6
Showing
4 changed files
with
100 additions
and
257 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: MIT | ||
name: Test | ||
on: pull_request | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
APP_NAME: contacts | ||
|
||
jobs: | ||
backend-unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1', '8.2', '8.3'] | ||
nextcloud-versions: ['master', 'stable30'] | ||
include: | ||
- php-versions: '8.4' | ||
nextcloud-versions: 'master' | ||
name: php${{ matrix.php-versions }} branch ${{ matrix.nextcloud-versions }} unit tests | ||
|
||
steps: | ||
- name: Set up Nextcloud env | ||
uses: ChristophWurst/setup-nextcloud@fc0790385c175d97e88a7cb0933490de6e990374 # v0.3.2 | ||
with: | ||
nextcloud-version: ${{ matrix.nextcloud-versions }} | ||
php-version: ${{ matrix.php-versions }} | ||
php-coverage: 'xdebug' | ||
patch-php-version-check: ${{ matrix.php-versions == '8.4' }} | ||
node-version: 'false' | ||
install: true | ||
|
||
- name: Checkout App | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
path: nextcloud/apps/${{ env.APP_NAME }} | ||
|
||
- name: Install dependencies | ||
working-directory: nextcloud/apps/${{ env.APP_NAME }} | ||
run: composer install | ||
|
||
- name: Run tests | ||
working-directory: nextcloud/apps/${{ env.APP_NAME }} | ||
run: composer run test:unit | ||
if: ${{ matrix.php-versions == '8.3' }} | ||
env: | ||
XDEBUG_MODE: coverage | ||
|
||
- name: Run tests | ||
working-directory: nextcloud/apps/${{ env.APP_NAME }} | ||
run: composer run test:unit | ||
if: ${{ matrix.php-versions != '8.3' }} | ||
env: | ||
XDEBUG_MODE: off | ||
|
||
- name: Upload coverage to Codecov | ||
if: ${{ matrix.php-versions != '8.3' }} | ||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: nextcloud/apps/${{ env.APP_NAME }}/clover.unit.xml | ||
flags: php | ||
fail_ci_if_error: ${{ !github.event.pull_request.head.repo.fork }} | ||
verbose: true | ||
|
||
summary: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- backend-unit-tests | ||
|
||
if: always() | ||
|
||
name: test-summary | ||
|
||
steps: | ||
- name: Unit test status | ||
run: if ${{ needs.unit-tests.result != 'success' && needs.unit-tests.result != 'skipped' }}; then exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
comment: false | ||
ignore: | ||
- "tests" | ||
- "lib/Vendor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
- SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc. | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
<phpunit bootstrap="tests/bootstrap.php" | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="tests/bootstrap.php" | ||
verbose="true" | ||
convertDeprecationsToExceptions="true" | ||
colors="true" | ||
timeoutForSmallTests="900" | ||
timeoutForMediumTests="900" | ||
timeoutForLargeTests="900"> | ||
<testsuite name='Contacts app tests'> | ||
<directory>./tests/unit</directory> | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"> | ||
<testsuite name="unit"> | ||
<directory suffix="Test.php">./tests/unit</directory> | ||
</testsuite> | ||
<!-- filters for code coverage --> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./</directory> | ||
<exclude> | ||
<directory suffix=".php">./l10n</directory> | ||
<directory suffix=".php">./templates</directory> | ||
<directory suffix=".php">./tests</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./lib</directory> | ||
</include> | ||
<report> | ||
<clover outputFile="./clover.unit.xml"/> | ||
</report> | ||
</coverage> | ||
</phpunit> |