Skip to content

Commit 73a99f1

Browse files
authored
Merge pull request #57 from happyprime/repo-sync/projects/default
Update: synced file(s) with happyprime/projects
2 parents c53efcc + 95b4a26 commit 73a99f1

File tree

5 files changed

+48
-69
lines changed

5 files changed

+48
-69
lines changed

.github/workflows/phpstan.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Run PHPStan and comment on the pull request with any issues.
2+
#
3+
# This file is managed in https://github.com/happyprime/projects
4+
name: PHPStan (Default, PHP 8.3)
5+
6+
on: pull_request
7+
8+
# The GITHUB_TOKEN used by Dependabot has read-only permissions by default. We
9+
# provide write permissions to this workflow so that comments can be left on
10+
# the pull request.
11+
#
12+
# @see https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
17+
jobs:
18+
call-workflow:
19+
uses: happyprime/workflows/.github/workflows/phpstan.yml@trunk
20+
with:
21+
php-version: '8.3'

.github/workflows/phpunit.yml

Lines changed: 5 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Run PHPUnit.
2+
#
3+
# This file is managed in https://github.com/happyprime/projects
14
name: PHPUnit
25

36
on:
@@ -9,69 +12,5 @@ on:
912
- trunk
1013

1114
jobs:
12-
phpunit:
13-
name: PHPUnit (PHP ${{ matrix.php }} with WordPress ${{ matrix.wordpress }})
14-
runs-on: ubuntu-latest
15-
16-
services:
17-
mysql:
18-
image: mysql:5.7
19-
ports:
20-
- 3306/tcp
21-
env:
22-
MYSQL_ROOT_PASSWORD: password
23-
# Set health checks to wait until mysql has started
24-
options: >-
25-
--health-cmd "mysqladmin ping"
26-
--health-interval 10s
27-
--health-timeout 5s
28-
--health-retries 3
29-
30-
continue-on-error: ${{ matrix.experimental }}
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
php: ['7.4', '8.0', '8.2']
35-
wordpress: ['latest']
36-
experimental: [false]
37-
include:
38-
- php: '8.3'
39-
wordpress: 'trunk'
40-
experimental: true
41-
42-
steps:
43-
- name: Checkout
44-
uses: actions/checkout@v4
45-
46-
- name: Setup PHP
47-
uses: shivammathur/setup-php@v2
48-
with:
49-
php-version: ${{ matrix.php }}
50-
coverage: none
51-
extensions: mysqli
52-
tools: composer, cs2pr
53-
54-
- name: Install WordPress test setup
55-
env:
56-
WP_VERSION: ${{ matrix.wordpress }}
57-
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
58-
run: bash bin/install-wp-tests.sh wordpress_test root password "127.0.0.1:$MYSQL_PORT" "$WP_VERSION"
59-
60-
- name: Get Composer cache directory
61-
id: composer-cache
62-
run: |
63-
echo "::set-output name=dir::$(composer config cache-files-dir)"
64-
65-
- name: Setup cache
66-
uses: pat-s/[email protected]
67-
with:
68-
path: ${{ steps.composer-cache.outputs.dir }}
69-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
70-
restore-keys: |
71-
${{ runner.os }}-composer-
72-
73-
- name: Install dependencies
74-
run: composer install --no-interaction --no-scripts
75-
76-
- name: Run tests
77-
run: composer phpunit
15+
call-workflow:
16+
uses: happyprime/workflows/.github/workflows/phpunit.yml@trunk

.github/workflows/plugin-check.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Run WP.org's plugin check.
2+
#
3+
# This file is managed in https://github.com/happyprime/projects
4+
name: WP.org Plugin Check
5+
6+
on:
7+
push:
8+
branches:
9+
- trunk
10+
pull_request:
11+
branches:
12+
- trunk
13+
14+
jobs:
15+
call-workflow:
16+
uses: happyprime/workflows/.github/workflows/plugin-check.yml@trunk
17+
with:
18+
php-version: '8.3'

phpstan.neon.dist

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ includes:
22
- %rootDir%/../../happyprime/coding-standards/phpstan.neon.dist
33

44
parameters:
5-
level: 6
5+
level: 5
66
ignoreErrors:
7-
-
8-
identifier: missingType.generics
7+
- '#Parameter \#1 \$postarr of function wp_update_post expects array\{ID\?\: int, post_author\?\: int, post_date\?\: string, post_date_gmt\?\: string, post_content\?\: string, post_content_filtered\?\: string, post_title\?\: string, post_excerpt\?\: string, \.\.\.\}, WP_Post\|null given\.#'

plugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Plugin URI: https://github.com/happyprime/shadow-terms/
77
* Author: Happy Prime
88
* Author URI: https://happyprime.co
9+
* License: GPLv2 or later
10+
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
911
* Text Domain: shadow-terms
1012
* Requires PHP: 7.4
1113
*

0 commit comments

Comments
 (0)