-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.84 KB
/
on-pull-request.yml
File metadata and controls
76 lines (63 loc) · 1.84 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
name: PHPCS & PHPUnit check
on:
pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
phpcs:
name: PHPCS check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
ini-values: "memory_limit=1G"
coverage: none
tools: cs2pr
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Run PHPCS checks
continue-on-error: true
run: composer phpcs
- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml
phpunit:
name: PHPUnit tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: wpmvc_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
extensions: mysql
coverage: none
- name: Install SVN
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Setup WordPress tests
run: composer test:setup
env:
WP_VERSION: latest
- name: Run PHPUnit tests
run: composer test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/phpunit-report.xml'