Skip to content

Commit

Permalink
Merge pull request #495 from buddypress/feature/bp-coding-standards-u…
Browse files Browse the repository at this point in the history
…pdate

Use the versioned `buddypress/bp-coding-standards` from packagist
  • Loading branch information
renatonascalves authored Mar 19, 2024
2 parents 0292fab + cfc1ec5 commit 4bb1a70
Show file tree
Hide file tree
Showing 12 changed files with 1,470 additions and 1,184 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.2']
php: ['8.3']

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected].0
uses: styfle/[email protected].1
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,9 +35,9 @@ jobs:
run: composer validate --strict

- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs"
composer-options: "--ignore-platform-reqs --optimize-autoloader"

- name: Run PHPCS
run: composer phpcs
29 changes: 14 additions & 15 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
- php: '7.4'
wp_version: '6.4'
- php: '7.4'
wp_version: '5.8'
wp_version: '6.1'
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp_version }}

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected].0
uses: styfle/[email protected].1
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check Gitignored files
run: if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi
Expand All @@ -45,19 +45,18 @@ jobs:
tools: composer:v2
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
composer-options: "--ignore-platform-reqs"
node-version: '>=20.10.0'

- name: Adapt WP PHPUnit version for WP < 6.1
run: |
if [ ${{ env.WP_VERSION }} == '5.8' ]; then
composer require wp-phpunit/wp-phpunit:6.0 --dev --ignore-platform-reqs
fi
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs --optimize-autoloader"

- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -70,7 +69,7 @@ jobs:
${{ runner.os }}-
- name: Validate node modules
run: if [[ -f package.json ]]; then npm audit --audit-level=high --production --cache ~/.npm; fi
run: if [[ -f package.json ]]; then npm audit --audit-level=high --omit=dev --cache ~/.npm; fi

- name: Install node modules
run: npm ci --cache ~/.npm
Expand All @@ -84,11 +83,11 @@ jobs:
npm run wp-env start -- --update
- name: Running single site unit tests
run: npm run phpunit
run: npm run test-php
if: ${{ success() || failure() }}

- name: Running multisite unit tests
run: npm run phpunit:mu
run: npm run test-php-multisite
if: ${{ success() || failure() }}

- name: Stop Docker environment
Expand Down
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"core": "WordPress/WordPress#master",
"plugins": [".", "buddypress/buddypress#master"],
"plugins": ["buddypress/buddypress#master", "."],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ We have extensive documentation of each endpoint/components and their CRUD actio

## System Requirements (relevant for CI tests only)

* PHP >= 5.6
* WP >= 5.8
* PHP >= 7.4
* WP >= 6.1
* BuddyPress >= Latest

## Installation

Drop this plugin in the wp-content/plugins directory and activate it. You need at least [WordPress 5.8](https://wordpress.org/download/) and [BuddyPress](https://buddypress.org/download/) to use the plugin.
Drop this plugin in the wp-content/plugins directory and activate it. You need at least [WordPress 6.1](https://wordpress.org/download/) and [BuddyPress](https://buddypress.org/download/) to use the plugin.

## About

Expand Down
2 changes: 1 addition & 1 deletion bp-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Version: 0.9.0
* Text Domain: buddypress
* Domain Path: /languages/
* Requires at least: 5.8
* Requires at least: 6.1
* Tested up to: 6.4
* Requires PHP: 5.6
* Requires Plugins: buddypress
Expand Down
29 changes: 11 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,24 @@
"source": "https://buddypress.trac.wordpress.org/browser/",
"wiki": "https://codex.buddypress.org/"
},
"repositories": [
{
"url": "https://github.com/buddypress/bp-coding-standards.git",
"type": "git"
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
}
],
},
"require": {
"composer/installers": "^1.10.0",
"php": ">=5.6.0"
},
"require-dev": {
"buddypress/bp-coding-standards": "dev-trunk",
"wp-phpunit/wp-phpunit": "^6.4",
"buddypress/bp-coding-standards": "0.1.0",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
"phpcs": "phpcs . --basepath=.",
"phpcbf": "phpcbf . --basepath=.",
"phpunit": "phpunit",
"phpunit:mu": "phpunit -c tests/multisite.xml"
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
"test": "@php ./vendor/phpunit/phpunit/phpunit",
"test_multi": "@php ./vendor/phpunit/phpunit/phpunit -c tests/multisite.xml",
"phpunit": "@test",
"phpcs": "@php ./vendor/bin/phpcs . --basepath=.",
"phpcbf": "@php ./vendor/bin/phpcbf . --basepath=."
}
}
Loading

0 comments on commit 4bb1a70

Please sign in to comment.