Add Copilot PHPUnit setup workflow #1
This file contains hidden or 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
| name: Copilot Setup Steps | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| pull_request: | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| jobs: | |
| copilot-setup-steps: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| services: | |
| database: | |
| image: mysql:latest | |
| env: | |
| MYSQL_DATABASE: wordpress_tests | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP version | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.0' | |
| extensions: simplexml, mysql | |
| tools: phpunit-polyfills:1.1 | |
| coverage: none | |
| - name: Install WordPress test suite prerequisites | |
| run: sudo apt-get update && sudo apt-get install -y subversion default-mysql-client | |
| - name: Install WordPress Test Suite | |
| run: composer install-wp-tests | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Verify PHPUnit is available | |
| run: composer phpunit -- --version |