Repository navigation
101 lines (83 loc) · 2.48 KB
/
Copy pathphpunit.yml
File metadata and controls
101 lines (83 loc) · 2.48 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: PHPUnit Tests
permissions:
contents: read
packages: write
on:
pull_request:
push:
branches: main
env:
IMAGE: ghcr.io/kevinbatdorf/php-no-mbregex:8.4
jobs:
mbregex-present:
name: PHPUnit (mbregex present)
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }} - present - ${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: cbp_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, mysqli
coverage: none
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Download WordPress
run: curl -sL https://wordpress.org/latest.tar.gz | tar xz
- name: Run PHPUnit
run: composer test
env:
WP_ABSPATH: ${{ github.workspace }}/wordpress
image:
name: Build the PHP image without mbregex
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
file: .github/docker/php-no-mbregex.Dockerfile
push: true
tags: ${{ env.IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max
mbregex-absent:
name: PHPUnit (mbregex absent)
runs-on: ubuntu-latest
needs: image
container: ghcr.io/kevinbatdorf/php-no-mbregex:8.4
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: cbp_test
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v6
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress
- name: Download WordPress
run: curl -sL https://wordpress.org/latest.tar.gz | tar xz
- name: Run PHPUnit
run: composer test
env:
WP_ABSPATH: ${{ github.workspace }}/wordpress
WP_DB_HOST: mysql:3306