Skip to content

Commit 89c2a9d

Browse files
authored
Merge pull request #267 from indieweb/update/plugin-structure
Update and simplify plugin structure
2 parents 92c20f2 + f8e6e49 commit 89c2a9d

33 files changed

+870
-1385
lines changed

.codeclimate.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.distignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ push.sh
1515
phpunit.xml
1616
phpunit.xml.dist
1717
phpcs.xml
18-
README.md
19-
readme.md
2018
.travis.yml
2119
.distignore
2220
.gitignore

.editorconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@ charset = utf-8
1010

1111
[*.php]
1212
indent_style = tab
13-
indent_size = 4
14-
15-
[*.{js,json}]
16-
indent_style = space
17-
indent_size = 2
13+
indent_size = 4

.github/workflows/deploy.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
name: Deploy to WordPress.org
2+
23
on:
34
push:
45
tags:
5-
- "*"
6+
- '*'
7+
68
jobs:
79
tag:
810
name: New tag
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v3
12-
- name: WordPress Plugin Deploy
13-
uses: 10up/action-wordpress-plugin-deploy@stable
14-
env:
15-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
16-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
17-
SLUG: indieweb
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: WordPress Plugin Deploy
17+
uses: 10up/action-wordpress-plugin-deploy@stable
18+
env:
19+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
20+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
21+
SLUG: indieweb

.github/workflows/phpcs.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
name: PHP_CodeSniffer
2-
on: push
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
paths:
8+
- '**.php'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
- 'phpcs.xml'
12+
- '.github/workflows/phpcs.yml'
13+
pull_request:
14+
paths:
15+
- '**.php'
16+
- 'composer.json'
17+
- 'composer.lock'
18+
- 'phpcs.xml'
19+
- '.github/workflows/phpcs.yml'
20+
321
jobs:
422
phpcs:
523
runs-on: ubuntu-latest
624
steps:
725
- name: Checkout
8-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
27+
928
- name: Setup PHP
1029
uses: shivammathur/setup-php@v2
1130
with:
12-
php-version: '7.4'
31+
php-version: '8.2'
1332
coverage: none
1433
tools: composer, cs2pr
15-
- name: Install Composer dependencies for PHP
16-
uses: "ramsey/composer-install@v2"
17-
- name: Detect coding standard violations
18-
run: composer lint
1934

35+
- name: Install Composer dependencies
36+
uses: ramsey/composer-install@v3
37+
38+
- name: Detect coding standard violations
39+
run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr

.github/workflows/phpunit.yml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,65 @@
11
name: Unit Testing
2+
23
on:
3-
push:
4-
pull_request:
4+
push:
5+
branches:
6+
- trunk
7+
paths:
8+
- '**.php'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
- 'phpunit.xml.dist'
12+
- '.github/workflows/phpunit.yml'
13+
pull_request:
14+
paths:
15+
- '**.php'
16+
- 'composer.json'
17+
- 'composer.lock'
18+
- 'phpunit.xml.dist'
19+
- '.github/workflows/phpunit.yml'
20+
521
jobs:
622
phpunit:
723
runs-on: ubuntu-latest
824
services:
9-
mysql:
10-
image: mariadb:10.4
11-
env:
12-
MYSQL_ROOT_PASSWORD: root
13-
ports:
14-
- 3306:3306
15-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
25+
mysql:
26+
image: mariadb:10.4
27+
env:
28+
MYSQL_ROOT_PASSWORD: root
29+
ports:
30+
- 3306:3306
31+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
1632
strategy:
1733
matrix:
18-
php-versions: ['7.2', '7.3', '7.4', '8.0']
34+
php-versions: ['7.4', '8.0', '8.2', '8.3']
35+
wp-version: ['latest']
36+
include:
37+
- php-versions: '7.4'
38+
wp-version: '6.2'
39+
- php-versions: '8.3'
40+
wp-version: 'trunk'
1941
steps:
2042
- name: Checkout
21-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
44+
45+
- name: Install subversion
46+
run: sudo apt-get update && sudo apt-get install -y subversion
47+
2248
- name: Setup PHP
2349
uses: shivammathur/setup-php@v2
2450
with:
2551
php-version: ${{ matrix.php-versions }}
2652
coverage: none
27-
tools: composer, , phpunit-polyfills
53+
tools: composer, phpunit-polyfills
2854
extensions: mysql
29-
- name: Install Composer dependencies for PHP
30-
uses: "ramsey/composer-install@v2"
55+
56+
- name: Install Composer dependencies
57+
uses: ramsey/composer-install@v3
58+
3159
- name: Setup Test Environment
32-
run: composer setup-local-tests
33-
- name: Unit Testing
34-
run: composer phpunit
60+
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp-version }}
61+
62+
- name: Run PHPUnit
63+
run: ./vendor/bin/phpunit --colors=always
3564
env:
3665
PHP_VERSION: ${{ matrix.php-versions }}
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
name: Plugin asset/readme update
2+
23
on:
34
push:
45
branches:
5-
- trunk
6+
- trunk
7+
68
jobs:
79
trunk:
810
name: Push to trunk
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v3
12-
- name: WordPress.org plugin asset/readme update
13-
uses: 10up/action-wordpress-plugin-asset-update@stable
14-
env:
15-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
16-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
17-
SLUG: indieweb
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: WordPress.org plugin asset/readme update
17+
uses: 10up/action-wordpress-plugin-asset-update@stable
18+
env:
19+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
20+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
21+
SLUG: indieweb
22+
README_NAME: readme.md

.wp-env.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"core": null,
3+
"plugins": [ "." ],
4+
"env": {
5+
"tests": {
6+
"mappings": {
7+
"wp-content/plugins/indieweb": "."
8+
}
9+
}
10+
}
11+
}

Gruntfile.js

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)