Merge pull request #81 from Automattic/update/svn-in-ci-runners #28
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: CI | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: 'Run tests (PHP ${{ matrix.php }}, WordPress ${{ matrix.wp }}, multisite: ${{ matrix.multisite }})' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
wp: | |
- latest | |
multisite: | |
- 'no' | |
include: | |
- php: '8.1' | |
wp: latest | |
multisite: yes | |
services: | |
mysql: | |
image: ghcr.io/automattic/vip-container-images/mariadb-lite:10.3 | |
ports: | |
- "3306:3306" | |
env: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MARIADB_INITDB_SKIP_TZINFO: 1 | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress_test | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v3 | |
- name: Install svn | |
run: sudo apt-get update && sudo apt-get install -y subversion | |
shell: bash | |
- name: Set up PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php }} | |
env: | |
fail-fast: 'true' | |
- name: Install PHP Dependencies | |
uses: ramsey/[email protected] | |
- name: Set up WordPress and WordPress Test Library | |
uses: sjinks/[email protected] | |
with: | |
version: ${{ matrix.wp }} | |
- name: Set up multisite mode | |
run: echo "WP_MULTISITE=1" >> $GITHUB_ENV | |
if: matrix.multisite == 'yes' | |
- name: Verify MariaDB connection | |
run: | | |
echo Waiting for MySQL to come online... | |
while ! mysqladmin ping -h 127.0.0.1 -P 3306 --silent; do | |
sleep 1 | |
done | |
timeout-minutes: 1 | |
- name: Run tests | |
run: vendor/bin/phpunit |