-
Notifications
You must be signed in to change notification settings - Fork 34
77 lines (67 loc) · 1.85 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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/setup-php@2.32.0
with:
php-version: ${{ matrix.php }}
env:
fail-fast: 'true'
- name: Install PHP Dependencies
uses: ramsey/composer-install@3.0.0
- name: Set up WordPress and WordPress Test Library
uses: sjinks/setup-wordpress-test-library@v2.1.3
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