mirror of
https://gh.wpcy.net/https://github.com/discourse/wp-discourse.git
synced 2026-05-25 05:03:57 +08:00
* Update phpunit * phpunit dependency should only be require-dev * Exclude tests from CI php version syntax check * We only need to run sniff and jshint on the latest supported version * Run tests on php 8.2
52 lines
1.2 KiB
YAML
Vendored
52 lines
1.2 KiB
YAML
Vendored
name: WP-Discourse Formatting
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Formatting on PHP ${{ matrix.php }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- php: '5.6'
|
|
- php: '7.0'
|
|
- php: '7.4'
|
|
- php: '8.0'
|
|
sniff: true
|
|
jshint: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Syntax Check
|
|
run: |
|
|
find -L . -name '*.php' -not -path "./vendor/*" -not -path "./tests/*" -print0 | xargs -0 -n 1 -P 4 php -l
|
|
|
|
- name: Install Composer
|
|
if: 'matrix.sniff'
|
|
uses: ramsey/composer-install@v2
|
|
with:
|
|
dependency-versions: 'highest'
|
|
composer-options: '--ignore-platform-reqs'
|
|
|
|
- name: WordPress Coding Standards
|
|
if: 'matrix.sniff'
|
|
run: |
|
|
vendor/bin/phpcs -p -s -v -n . -d error_reporting=E_ALL^E_DEPRECATED
|
|
|
|
- name: JSHint
|
|
if: 'matrix.jshint'
|
|
run: |
|
|
sudo npm install -g jshint
|
|
wget https://develop.svn.wordpress.org/trunk/.jshintrc
|
|
jshint .
|