{"id":25368268,"url":"https://github.com/discoverygarden/phpunit-action","last_synced_at":"2026-05-12T12:42:01.485Z","repository":{"id":198531426,"uuid":"594116824","full_name":"discoverygarden/phpunit-action","owner":"discoverygarden","description":"Github action to launch PHPUnit tests.","archived":false,"fork":false,"pushed_at":"2024-08-05T11:41:41.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-15T00:36:52.363Z","etag":null,"topics":["github-actions","phpunit"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discoverygarden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T16:32:41.000Z","updated_at":"2024-08-05T11:41:31.000Z","dependencies_parsed_at":"2023-10-10T19:06:06.891Z","dependency_job_id":"cf2ff93b-0bb8-487a-90f0-1c14f4941749","html_url":"https://github.com/discoverygarden/phpunit-action","commit_stats":null,"previous_names":["discoverygarden/phpunit-action"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fphpunit-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fphpunit-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fphpunit-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fphpunit-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discoverygarden","download_url":"https://codeload.github.com/discoverygarden/phpunit-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987235,"owners_count":21028895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","phpunit"],"created_at":"2025-02-15T00:36:54.482Z","updated_at":"2026-05-12T12:42:01.446Z","avatar_url":"https://github.com/discoverygarden.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpunit-action\nGithub action to launch PHPUnit tests configured for a module.\n\n## Inputs\n-  **composer-auth:** Composer auth token necessary for accessing our composer project. (Required)\n-  **composer_package:** Composer project reference. (optional)(Default: The repository fullname. ex. 'discoverygarden/phpunit-action')\n-  **drupal_extension:** The module name for enabling within drupal. (optional)(Default: Repository name. ex. 'phpunit-action')\n-  **composer_patches:** Additional composer patches that might be necessary to run the workflow. (optional)\n   - ```yaml\n        composer_patches: |-\n        {\n          \"drupal/core\": {\n            \"Postgres Driver\":\"https://www.drupal.org/files/issues/2022-01-11/2920527-26.patch\"\n          }\n        }\n     ```\n-  **composer_package_prerequisites:** require-dev modules required for the module that might not otherwise get installed. (optional)\n   - ```yaml\n        composer_package_prerequisites: \u003e-\n          \"discoverygarden/relator_creator_processor:^1\"\n     ```\n-  **drupal_root:** The root drupal directory. (optional)(Default: /opt/drupal)\n-  **drupal_web_root:** The drupal web root directory. (Default: /opt/drupal/web)\n-  **postgres_db:** The postgres database name. (Default: drupal)\n-  **postgres_user:** The postgres database user. (Default: drupal)\n-  **postgres_password:** The postgress database user password. (Default: drupal)\n-  **apache_user:** The apache user. (Default: www-data)\n-  **apache_user_group:** The apache user group. (Default: www-data)\n\n## Output\nThis action does not output any artifacts.\n\n## Secrets\nThis action specifically uses the composer-auth organization token in order to have read access to our composer projects:\n- PRIVATE_PACKAGIST_AUTH_ACCESS\n\n## Usage\nLearn more about GitHub Actions in general [here](https://docs.github.com/en/actions/quickstart). \n\nTo use this action in your repo, follow these steps:\n\n 1. Create a YAML file in the `.github/workflows/` directory of your repo labeled 'phpunit.yml'\n 2. Copy the following into the YAML file:\n```yaml\nname: PHPUnit Tests\non:\n  pull_request:\n    branches:\n      - main\njobs:\n  PHPUnit:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        drupal-version: ['9.4']\n        php-version: ['7.4', '8.0']\n        experimental: [false]\n        include:\n          - drupal-version: '9'\n            php-version: '7.4'\n            experimental: true\n          - drupal-version: '9'\n            php-version: '8.1'\n            experimental: true\n          - drupal-version: '9.4'\n            php-version: '8.1'\n            experimental: true\n    continue-on-error: ${{ matrix.experimental }}\n    container:\n      image: drupal:${{ matrix.drupal-version }}-php${{ matrix.php-version }}\n      ports:\n        - 80\n    services:\n      postgres:\n        image: postgres\n        env:\n          POSTGRES_DB: drupal\n          POSTGRES_USER: drupal\n          POSTGRES_PASSWORD: drupal\n        # Set health checks to wait until postgres has started\n        options: \u003e-\n          --health-cmd pg_isready\n          --health-interval 10s\n          --health-timeout 5s\n          --health-retries 5\n    steps:\n      - name: Run PHPUnit Action\n        uses: discoverygarden/phpunit-action@implementation\n        with:\n          composer-auth: ${{ secrets.PRIVATE_PACKAGIST_AUTH_ACCESS }}\n```\nThis action will run the module defined tests against the repository when there is a pull request against the defined branches (Default: `main` branch).\n\nThis example is running this action in a matrix strategy of various drupal-project and php version configurations for additional operational security.\n\nAdditionally, if calling this action within a company owned module, the action call can be simplified even further to the following:\n```yaml\n---\nname: PHPUnit Tests\non:\n  pull_request:\n    branches:\n      - main\n  workflow_dispatch:\n\njobs:\n  PHPUnit:\n    uses: discoverygarden/phpunit-action/.github/workflows/phpunit.yml@\u003ccurrent version constraint\u003e\n    secrets: inherit\n```\nDefining it in this way will run the version of the workflow defined within this repository at `.github/workflows/phpunit.yml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverygarden%2Fphpunit-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscoverygarden%2Fphpunit-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverygarden%2Fphpunit-action/lists"}