Test #299
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: | |
- trunk | |
pull_request: | |
branches: | |
- trunk | |
jobs: | |
phpunit: | |
name: PHP Unit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Start MySQL | |
run: sudo systemctl start mysql.service | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Set cache directories | |
run: | | |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}" | |
- name: Prepare composer cache | |
uses: actions/cache@v3 | |
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: 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 |