diff options
author | Nextcloud bot <bot@nextcloud.com> | 2022-10-15 15:37:40 +0300 |
---|---|---|
committer | Nextcloud bot <bot@nextcloud.com> | 2022-10-15 15:37:40 +0300 |
commit | 82f4024cd8a77764df375cc22f10c2313ae50a88 (patch) | |
tree | 166c2dd598b0705af6febb044c5861c8b990b162 | |
parent | 3c8018ee30ff258947b8db172295793d571a6ef0 (diff) |
Updating phpunit-oci.yml workflow from template
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
-rw-r--r-- | .github/workflows/phpunit-oci.yml | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml index 390c50e..3744e69 100644 --- a/.github/workflows/phpunit-oci.yml +++ b/.github/workflows/phpunit-oci.yml @@ -1,12 +1,37 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + name: PHPUnit on: pull_request: + paths: + - '.github/workflows/**' + - 'appinfo/**' + - 'lib/**' + - 'templates/**' + - 'tests/**' + - 'vendor/**' + - 'vendor-bin/**' + - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + push: branches: + - main - master - stable* +permissions: + contents: read + +concurrency: + group: phpunit-oci-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + env: # Location of the phpunit.xml and phpunit.integration.xml files PHPUNIT_CONFIG: ./tests/phpunit.xml @@ -14,11 +39,9 @@ env: jobs: phpunit-oci: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: - # do not stop on another job's failure - fail-fast: false matrix: php-versions: ['8.0'] server-versions: ['master'] @@ -55,7 +78,15 @@ jobs: tools: phpunit coverage: none + - name: Check composer file existence + id: check_composer + uses: andstor/file-existence-action@v1 + with: + files: apps/${{ env.APP_NAME }}/composer.json + - name: Set up PHPUnit + # Only run if phpunit config file exists + if: steps.check_composer.outputs.files_exists == 'true' working-directory: apps/${{ env.APP_NAME }} run: composer i @@ -66,7 +97,6 @@ jobs: 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 app:enable --force ${{ env.APP_NAME }} - php -S localhost:8080 & - name: Check PHPUnit config file existence id: check_phpunit @@ -86,6 +116,11 @@ jobs: with: files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }} + - name: Run Nextcloud + # Only run if phpunit integration config file exists + if: steps.check_integration.outputs.files_exists == 'true' + run: php -S localhost:8080 & + - name: PHPUnit integration # Only run if phpunit integration config file exists if: steps.check_integration.outputs.files_exists == 'true' @@ -93,6 +128,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-oci |