Skip to content

Adjust the "Tested up to" values and Update Min PHP to 7.2 #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
04af94c
Upgrade CI configuration
szepeviktor Nov 4, 2020
18c2419
Bump 'Tested up to' versions
stevegrunwell Mar 26, 2021
aebbcbb
Merge remote-tracking branch 'szepeviktor/patch-1' into update/tested…
stevegrunwell Mar 26, 2021
2353692
Update the WordPress + WooCommerce versions in the CI pipeline, add P…
stevegrunwell Mar 26, 2021
cd29e54
Update Composer dependencies
stevegrunwell Mar 26, 2021
ca475ff
Remove WordPress stubs, as they're provided by the WooCommerce stubs
stevegrunwell Mar 26, 2021
5664481
Test plugin up to WooCommerce 7.1 and adjust minimum PHP version to 7…
bswatson Nov 11, 2022
20dc73f
Update the plugin to use GitHub actions instead of Travis for continu…
bswatson Nov 11, 2022
53f252d
Force composer installer version to 2.0.
bswatson Nov 11, 2022
d226f08
Downgrading to Composer Installers 1.x to maintain compatibility with…
bswatson Nov 11, 2022
eb103ce
Remove unnecessary exclusion of the vendor directory. Thanks @szepevi…
bswatson Nov 11, 2022
60b90eb
Remove travis config since we no longer need it.
bswatson Nov 11, 2022
ad622f8
Adjust WooCommerce installation script to account for the monorepo.
bswatson Nov 11, 2022
a099a6d
Include the generation of the feature config file.
bswatson Nov 11, 2022
869146e
Include the path to the target directory.
bswatson Nov 11, 2022
0474ef9
Restore full test matrix.
bswatson Nov 11, 2022
09251f9
Update minimum supported versions of WordPress and WooCommerce.
bswatson Nov 11, 2022
a375888
Remove usage of protected match keyword.
bswatson Nov 11, 2022
22b4531
Modify the approach to including WooCommerce for testing.
bswatson Nov 14, 2022
76dcc70
Switch back to minimum supported WC version of 6.5.
bswatson Nov 14, 2022
591c1e8
Adjust minimum PHP version to be 7.4.
bswatson Nov 14, 2022
2c7b216
Removing compatibility with < WC 6.9.
bswatson Nov 14, 2022
1a25be0
Removing duplicate wordpress stubs which are already provided by szep…
bswatson Nov 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# This is the main Continuous Integration (CI) pipeline for the nexcess/limit-orders plugin.
#
# Any time code is pushed to one of the main branches or a PR is opened, this pipeline should be
# run to ensure everything still works as designed and meets our coding standards.
name: CI Pipeline

# Execute on pushes to develop or main, as well as all PRs.
on:
push:
branches:
- develop
- master
pull_request:

# Cancel outstanding jobs for this workflow/branch combo.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

# Execute all PHPUnit tests.
phpunit:
name: PHPUnit (PHP ${{ matrix.php-versions }}, WC ${{ matrix.wc-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Run on all versions of PHP supported by WooCommerce.
php-versions: ['7.4']
wc-versions: ['7.1']
# php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
# wc-versions: ['4.4.4', '6.9', '7.0', '7.1']

services:
mysql:
image: mysql:${{ (matrix.php-versions < 7.4 && '5.7') || '8.0' }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10

steps:
- uses: actions/checkout@v2

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, mysqli
coverage: none

- name: Remove unneeded Composer dependencies
run: |
composer remove --dev --no-progress --no-update \
wp-coding-standards/wpcs \
szepeviktor/phpstan-wordpress
- uses: ramsey/composer-install@v2
with:
dependency-versions: highest

- name: Set up WordPress
run: bash vendor/bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1:3306 latest

- name: Set up WooCommerce
run: DEBUG=1 bash tests/bin/install-woocommerce.sh ${{ matrix.wc-versions }}

- name: Run PHPUnit
run: composer test:unit

# Check coding standards (PHP_CodeSniffer, PHP-CS-Fixer)
coding-standards:
name: Coding standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring
coverage: none

- uses: ramsey/composer-install@v2

- name: Check coding standards
run: composer test:standards

# Static Code Analysis (PHPStan)
static-code-analysis:
name: Static code analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl
coverage: none

- uses: ramsey/composer-install@v2

- name: Run PHPStan
run: composer test:analysis
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ vendor/
# Hidden files
.DS_Store
Thumbs.db
.idea

# Local overrides
.phpcs.xml
Expand Down
4 changes: 2 additions & 2 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<file>src</file>
<file>limit-orders.php</file>

<!-- Ensure compatibility with PHP 7.0 and newer. -->
<config name="testVersion" value="7.0-" />
<!-- Ensure compatibility with PHP 7.2 and newer. -->
<config name="testVersion" value="7.2-" />
<rule ref="PHPCompatibilityWP" />

<!-- Requires WordPress 5.3 or newer. -->
Expand Down
50 changes: 22 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: php
dist: xenial

services:
- mysql
- mysql

notifications:
email:
Expand All @@ -14,62 +14,56 @@ cache:
- $HOME/.composer/cache

php:
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- '8.1'
- '8.0'
- '7.4'
- '7.3'
- '7.2'

# To keep the test matrix from exploding over time, we'll actively test against the latest three
# releases, then cherry-pick what to test across older ones.
env:
- WP_VERSION=latest WC_VERSION=4.5
- WP_VERSION=latest WC_VERSION=4.4
- WP_VERSION=latest WC_VERSION=4.3
- WP_VERSION=latest WC_VERSION=3.9.3
- WP_VERSION=latest WC_VERSION=7.1
- WP_VERSION=latest WC_VERSION=7.0
- WP_VERSION=latest WC_VERSION=6.9
- WP_VERSION=latest WC_VERSION=4.4.4

matrix:
fast_finish: true
include:
- name: Coding Standards
php: 7.3
php: '8.0'
env: WP_TRAVISCI=phpcs
- name: Static Code Analysis
php: 7.3
php: '8.0'
env: WP_TRAVISCI=phpstan
- name: Minimum requirements
php: 7.0
env: WP_VERSION=5.3 WC_VERSION=3.9.3
php: '7.2'
env: WP_VERSION=5.3 WC_VERSION=4.4.4
- name: Bleeding Edge
php: 7.4
php: '8.1'
env: WP_VERSION=trunk WC_VERSION=latest
allow_failures:
- name: Bleeding Edge

before_install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv config-rm xdebug.ini || true
- composer validate --strict

install:
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then
composer remove --dev szepeviktor/phpstan-wordpress --no-update
composer update --prefer-source --prefer-lowest --no-interaction --no-ansi
else
composer install --prefer-source --no-interaction --no-ansi
fi
- composer install --prefer-source --no-interaction --no-ansi
- |
if [[ $WP_TRAVISCI != 'phpcs' && $WP_TRAVISCI != 'phpstan' ]]; then
bash vendor/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
DEBUG=1 bash tests/bin/install-woocommerce.sh $WC_VERSION
bash vendor/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
DEBUG=1 bash tests/bin/install-woocommerce.sh $WC_VERSION
fi

script:
- |
if [[ $WP_TRAVISCI = 'phpcs' ]]; then
./vendor/bin/phpcs
composer test:standards
elif [[ $WP_TRAVISCI = 'phpstan' ]]; then
./vendor/bin/phpstan analyze
composer test:analysis
else
./vendor/bin/phpunit
composer test:unit
fi
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Limit Orders for WooCommerce lets you limit the number of orders your store will
## Requirements

* WordPress 5.3 or newer
* WooCommerce 3.9 or newer
* PHP 7.0 or newer
* WooCommerce 4.4 or newer
* PHP 7.2 or newer

## Installation

Expand Down
38 changes: 25 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nexcess/limit-orders-for-woocommerce",
"name": "nexcess/limit-orders",
"description": "Automatically disable WooCommerce's checkout process after reaching a maximum number of orders.",
"type": "wordpress-plugin",
"license": "MIT",
Expand All @@ -8,8 +8,8 @@
"woocommerce-extension"
],
"support": {
"issues": "https://github.com/nexcess/limit-orders-for-woocommerce/issues",
"source": "https://github.com/nexcess/limit-orders-for-woocommerce"
"issues": "https://github.com/nexcess/limit-orders/issues",
"source": "https://github.com/nexcess/limit-orders"
},
"readme": "README.md",
"authors": [
Expand All @@ -24,16 +24,19 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=7.0"
"php": "7.2",
"composer-runtime-api": "^2"
},
"require-dev": {
"assertwell/wp-core-test-framework": "^0.1.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.6",
"php-stubs/woocommerce-stubs": "^4.0",
"composer/installers": "^1.12",
"assertwell/wp-core-test-framework": "^0.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"phpcompatibility/phpcompatibility-wp": "*",
"phpunit/phpunit": "^6.5|^7.5",
"szepeviktor/phpstan-wordpress": "^0.6.0",
"wp-coding-standards/wpcs": "^2.2"
"phpunit/phpunit": "^7.5",
"php-stubs/woocommerce-stubs": "^7.1",
"szepeviktor/phpstan-wordpress": "^1.1",
"wp-coding-standards/wpcs": "^2.3",
"yoast/phpunit-polyfills": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -46,26 +49,35 @@
}
},
"scripts": {
"fix:standards": "./vendor/bin/phpcbf",
"test": [
"@test:unit",
"@test:standards",
"@test:analysis"
],
"test:analysis": "vendor/bin/phpstan analyze -c phpstan.neon.dist",
"test:analysis": "vendor/bin/phpstan analyze -c phpstan.neon.dist --memory-limit 512M",
"test:standards": "vendor/bin/phpcs",
"test:unit": "vendor/bin/phpunit --testdox --color=always"
},
"scripts-descriptions": {
"fix:standards": "Automatically fix coding standards violations where possible.",
"test": "Run all automated tests for the plugin.",
"test:analysis": "Perform static code analysis on the plugin.",
"test:standards": "Check the codebase against coding standards.",
"test:unit": "Run unit tests for the plugin."
},
"config": {
"platform": {
"php": "7.4"
"php": "7.2"
},
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"extra": {
"installer-disable": true
}
}
Loading