{"id":20163423,"url":"https://github.com/sjinks/setup-wordpress-test-library","last_synced_at":"2025-07-06T16:32:46.421Z","repository":{"id":36969549,"uuid":"502414524","full_name":"sjinks/setup-wordpress-test-library","owner":"sjinks","description":"Set up WordPress and WordPress Test Library for unit tests","archived":false,"fork":false,"pushed_at":"2025-06-27T20:32:18.000Z","size":7997,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T21:31:14.883Z","etag":null,"topics":["action","github-action","unit-testing","wordpress","wordpress-tests"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/set-up-wordpress-test-library","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-11T17:32:09.000Z","updated_at":"2025-06-27T20:32:21.000Z","dependencies_parsed_at":"2024-04-15T01:53:28.328Z","dependency_job_id":"fb8302ef-b614-4b46-908b-96073e383aed","html_url":"https://github.com/sjinks/setup-wordpress-test-library","commit_stats":{"total_commits":271,"total_committers":3,"mean_commits":90.33333333333333,"dds":"0.25461254612546125","last_synced_commit":"349e4e0c81d55d07e2a54f0bfe8399608077a526"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/sjinks/setup-wordpress-test-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fsetup-wordpress-test-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fsetup-wordpress-test-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fsetup-wordpress-test-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fsetup-wordpress-test-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/setup-wordpress-test-library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fsetup-wordpress-test-library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263934937,"owners_count":23532228,"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":["action","github-action","unit-testing","wordpress","wordpress-tests"],"created_at":"2024-11-14T00:29:31.927Z","updated_at":"2025-07-06T16:32:46.401Z","avatar_url":"https://github.com/sjinks.png","language":"TypeScript","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"readme":"# setup-wordpress-test-library\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sjinks_setup-wptl-action\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sjinks_setup-wptl-action)\n[![Build and Test](https://github.com/sjinks/setup-wptl-action/actions/workflows/ci.yml/badge.svg)](https://github.com/sjinks/setup-wptl-action/actions/workflows/ci.yml)\n[![CodeQL Analysis](https://github.com/sjinks/setup-wptl-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/sjinks/setup-wptl-action/actions/workflows/codeql-analysis.yml)\n\nThis action sets up WordPress and WordPress Test Library. WordPress plugins can make use of this action to run unit tests.\n\n## Inputs\n\n  * `version`: WordPress version to use. Can be `trunk` or `nightly` for the latest nightly build, `latest` for the latest available WordPress release, an explicit version number (like `6.0`) to install the specific WordPress version, or a partial version (`5.9.x`) to install the latest available patch for the specific WordPress release. The default value is `latest`.\n  * `dir`: target directory for WordPress and WordPress Test Library; the default value is `/tmp`. **Warning:** the system will delete `wordpress`, `wordpress-test-library`, and `wordpress.zip` from that directory if they exist.\n  * `db_user`: database user for WordPress, `wordpress` by default;\n  * `db_password`: database password for WordPress, `wordpress` by default;\n  * `db_name`: database name for WordPress, `wordpress_test` by default. **Warning:** WordPress Test Library may delete all tables from that database;\n  * `db_host`: database host (`127.0.0.1` by default) for WordPress.\n\n## Outputs\n\n  * `wp_version`: the actual WordPress version.\n\n## Environment Variables\n\nUpon success, the action sets the `WP_TESTS_DIR` environment variable; its value is the absolute path to the WordPress Test library\n\n## Example usage\n\n```yaml\nname: CI\n\non:\n  push:\n\npermissions:\n  contents: read\n\njobs:\n  testing:\n    name: Run tests\n    runs-on: ubuntu-latest\n    services:\n      mysql:\n        image: mariadb:latest\n        ports:\n          - '3306:3306'\n        env:\n          MYSQL_ROOT_PASSWORD: wordpress\n          MARIADB_INITDB_SKIP_TZINFO: 1\n          MYSQL_USER: wordpress\n          MYSQL_PASSWORD: wordpress\n          MYSQL_DATABASE: wordpress_test\n    steps:\n      - name: Check out the source code\n        uses: actions/checkout@v3\n\n      - name: Set up PHP\n        uses: shivammathur/setup-php@v2\n        with:\n          coverage: none\n          php-version: \"8.2\"\n\n      - name: Install PHP Dependencies\n        uses: ramsey/composer-install@v3\n\n      - name: Set up WordPress and WordPress Test Library\n        uses: sjinks/setup-wordpress-test-library@master\n        with:\n          version: latest\n\n      - name: Verify MariaDB connection\n        run: |\n          while ! mysqladmin ping -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} --silent; do\n            sleep 1\n          done\n        timeout-minutes: 1\n\n      - name: Run tests\n        run: vendor/bin/phpunit\n```\n\nSee the [Integration Testing](.github/workflows/ci-integration.yml) workflow for a real-world example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fsetup-wordpress-test-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fsetup-wordpress-test-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fsetup-wordpress-test-library/lists"}