diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-10-20 17:04:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 17:04:54 +0300 |
commit | 562e2e4a8883c4b4273f5fc394ffd54ca6c4ba32 (patch) | |
tree | 950fd00312353950d9fd57e8efe298361b7a6f7b | |
parent | 32d99b42c8b0aace00f66b369e8d399e4483b578 (diff) | |
parent | 036bf866c554c52ce58dd9671fc9a06537d0e8fc (diff) |
Merge pull request #966 from nextcloud/feat/workflow-auto-update-phpunit-mysql.yml
Updating phpunit-mysql.yml workflow from template
-rw-r--r-- | .github/workflows/phpunit-mysql.yml | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index 650e5def..a59a3f05 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -1,11 +1,30 @@ +# 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: - push: - branches: - - master - - stable* + paths: + - '.github/workflows/**' + - 'appinfo/**' + - 'lib/**' + - 'templates/**' + - 'tests/**' + - 'vendor/**' + - 'vendor-bin/**' + - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + +permissions: + contents: read + +concurrency: + group: phpunit-mysql-${{ github.head_ref || github.run_id }} + cancel-in-progress: true env: # Location of the phpunit.xml and phpunit.integration.xml files @@ -61,7 +80,15 @@ jobs: extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql 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 @@ -71,7 +98,7 @@ jobs: run: | mkdir data ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - ./occ app:enable ${{ env.APP_NAME }} + ./occ app:enable --force ${{ env.APP_NAME }} - name: Check PHPUnit config file existence id: check_phpunit @@ -79,9 +106,6 @@ jobs: with: files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }} - - name: Run Nextcloud - run: php -S localhost:8080 & - - name: PHPUnit # Only run if phpunit config file exists if: steps.check_phpunit.outputs.files_exists == 'true' @@ -94,6 +118,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' @@ -101,6 +130,8 @@ jobs: run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }} summary: + permissions: + contents: none runs-on: ubuntu-latest needs: phpunit-mysql |