-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (99 loc) · 2.85 KB
/
lint-test.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Lint & Test
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- '**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHP Lint
run: composer phpcs
wporg-validation:
name: WP.org Plugin Validation
runs-on: ubuntu-latest
steps:
- uses: pantheon-systems/[email protected]
with:
type: 'plugin'
validate-readme-spacing:
name: Validate README Spacing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pantheon-systems/validate-readme-spacing@v1
php8-compatibility:
name: PHP 8.x Compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PHP Compatibility
uses: pantheon-systems/phpcompatibility-action@dev
with:
test-versions: 8.0-
paths: ${{ github.workspace }}/*.php ${{ github.workspace }}/inc/*.php
test-phpunit-74:
needs: lint
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.5
name: PHP 7.4 Unit Tests
steps:
- uses: actions/checkout@v3
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysqli, zip, imagick
- name: Start MySQL Service
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: |
composer update && composer install
- name: Run PHP linting
run: composer phplint
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh
test-phpunit-83:
needs: lint
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6
name: PHP 8.3 Unit Tests
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mysqli, zip, imagick
- name: Start MySQL Service
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: composer install
- name: Run PHP linting
run: composer phplint
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh