Test #908
This file contains 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: Test | |
env: | |
COMPOSER_VERSION: "2" | |
COMPOSER_CACHE: "${{ github.workspace }}/.composer-cache" | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- develop | |
- trunk | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
phpunit: | |
name: PHPUnit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Start MySQL | |
run: sudo systemctl start mysql.service | |
- name: Set standard 10up cache directories | |
run: | | |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}" | |
- name: Prepare composer cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.COMPOSER_CACHE }} | |
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
composer-${{ env.COMPOSER_VERSION }}- | |
- name: Set PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
coverage: none | |
- name: Install dependencies | |
run: composer install | |
- name: Spin up Elasticsearch | |
run: git clone https://github.com/10up/ElasticPress.git elasticpress-plugin && cd elasticpress-plugin && npm run es:start | |
- name: Check ES response | |
run: curl --connect-timeout 5 --max-time 10 --retry 5 --retry-max-time 40 --retry-all-errors http://127.0.0.1:8890 | |
- name: Setup WP Tests | |
run: | | |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 | |
sleep 10 | |
- name: PHPUnit | |
run: | | |
composer run-script test |