Skip to content

Commit

Permalink
Add automated tests, require PHP 8 (#428)
Browse files Browse the repository at this point in the history
* Add automated tests

* cleanup

* Require Composer 2

* fix tests

* fix actions
  • Loading branch information
danepowell committed Dec 20, 2022
1 parent e664cf0 commit e2fedb8
Show file tree
Hide file tree
Showing 20 changed files with 2,752 additions and 1,048 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ indent_style = space
# Markdown customizations
[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.json]
indent_size = 2
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 2 * * *"
release:
types: [published]
jobs:
test:
runs-on: "ubuntu-22.04"
strategy:
matrix:
php: ["8.0", "8.1", "8.2"]
coverage: ["none"]
include:
- php: "8.2"
coverage: "xdebug"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
ini-file: development
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
- name: Composer install
run: composer install --no-interaction --optimize-autoloader
- name: Run tests
if: matrix.coverage == 'none'
run: composer test
- name: Run coverage
if: matrix.coverage == 'xdebug'
run: composer coverage
- name: Upload coverage results to Coveralls
if: matrix.coverage == 'xdebug'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: composer coveralls
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Simple patches plugin for Composer. Applies a patch from a local or remote file

## Support notes

* If you need PHP 5.3, 5.4, or 5.5 support, you should probably use a 1.x release.
* Beginning in 2.x, only PHP 8 and Composer 2 will be supported. If you need PHP 5 or PHP 7 support, use a 1.x release.
* 1.x is mostly unsupported, but bugfixes and security fixes will still be accepted.
1.7.0 will be the last minor release in the 1.x series.
* Beginning in 2.x, the automated tests will not allow us to use language features
Expand All @@ -26,7 +26,7 @@ Example composer.json:
{
"require": {
"cweagans/composer-patches": "~1.0",
"drupal/core-recommended": "^8.8",
"drupal/core-recommended": "^8.8"
},
"config": {
"preferred-install": "source"
Expand Down
1 change: 0 additions & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ paths:
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
extensions:
Expand Down
24 changes: 19 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@
}
],
"require": {
"php": ">=5.6.0",
"php": ">=8.0.0",
"ext-json": "*",
"composer-plugin-api": "^1.0 || ^2.0",
"cweagans/composer-configurable-plugin": "^1.0"
},
"require-dev": {
"composer/composer": "~1.0",
"codeception/codeception": "~4.0",
"satooshi/php-coveralls": "~1.0",
"phpro/grumphp": "^1.3.2",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"php-coveralls/php-coveralls": "~2.0",
"phpro/grumphp": "^1.8.0",
"php-parallel-lint/php-parallel-lint": "^1.0.0",
"sebastian/phpcpd": "^6.0",
"squizlabs/php_codesniffer": "^3.0"
"squizlabs/php_codesniffer": "^3.0",
"codeception/module-cli": "^2.0",
"codeception/module-filesystem": "^2.0",
"codeception/module-asserts": "^2.0"
},
"autoload": {
"psr-4": {"cweagans\\Composer\\": "src"}
Expand All @@ -37,5 +40,16 @@
"allow-plugins": {
"phpro/grumphp": true
}
},
"scripts": {
"static": "grumphp run",
"unit": "codecept run unit",
"acceptance": "codecept run acceptance",
"coverage": "codecept run --coverage-xml",
"test": [
"@static",
"@unit",
"@acceptance"
]
}
}

0 comments on commit e2fedb8

Please sign in to comment.