-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.01 KB
/
ci.yml
File metadata and controls
84 lines (69 loc) · 2.01 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
name: CI
on:
push:
branches: [trunk]
pull_request:
jobs:
phpcs:
name: PHPCS (WordPress + Docs)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none
- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer install
run: composer install --no-progress --prefer-dist --no-interaction
- name: Run PHPCS
run: composer run phpcs
phpunit:
name: PHPUnit (integration)
runs-on: ubuntu-latest
env:
WP_CORE_DIR: /tmp/wordpress/src
WP_TESTS_DIR: /tmp/wordpress/tests/phpunit
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none
- name: Install SVN
run: sudo apt-get install -y subversion
- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Composer install
run: composer install --no-progress --prefer-dist --no-interaction
- name: Install WP test environment
run: ./bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 latest
- name: Run PHPUnit
run: composer run test-unit