-
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (72 loc) · 2.16 KB
/
ci-integration.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
78
79
80
81
82
83
name: Integration Testing
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
integration:
name: Integration testing
permissions:
contents: read
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:latest
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: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
api.wordpress.org:80
api.wordpress.org:443
wordpress.org:443
develop.svn.wordpress.org:443
plugins.svn.wordpress.org:443
github.com:443
objects.githubusercontent.com:443
packagist.org:443
- name: Check out the source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
coverage: none
php-version: "8.2"
- name: Install PHP Dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0
with:
working-directory: wptest
- name: Set up WordPress and WordPress Test Library
uses: ./
with:
version: latest
- name: Verify MariaDB connection
run: |
while ! mysqladmin ping -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} --silent; do
sleep 1
done
timeout-minutes: 1
- name: Run tests
run: vendor/bin/phpunit
working-directory: wptest
- name: Set up WordPress and WordPress Test Library (from the tool cache)
uses: ./
with:
version: latest
- name: Rerun tests
run: vendor/bin/phpunit
working-directory: wptest