-
Notifications
You must be signed in to change notification settings - Fork 12
62 lines (47 loc) · 1.47 KB
/
test-php.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
name: Test:PHP
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.4
ports:
- '3306:3306'
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
php-version: '7.4'
tools: composer:v2
- name: Install dependencies
run: composer i
- name: Download ACF Prop plugin
uses: actions/checkout@v3
with:
repository: ${{ secrets.PAID_PLUGINS_REPO }}
token: ${{ secrets.HBG_GH_TOKEN }}
path: wp-paid-plugins
- name: Place ACF plugin in /tmp folder
run: unzip wp-paid-plugins/acf.zip -d /tmp && rm -rf /tmp/wp-paid-plugins
shell: bash
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Set up test environment
run: composer run test:setup test root root 127.0.0.1 latest true true
- name: Run tests
run: composer run test