Skip to content

Downgrade to PHP 7.4, move from Pest to PHPUnit, establish CI #25

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 5 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches:
- trunk
pull_request:

jobs:
php-cs-check:
name: 'PHP 7.4 compatibility (via PHP Code Sniffer)'
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: xdebug

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Check PHP version compatibility
uses: pantheon-systems/phpcompatibility-action@v1
with:
skip-php-setup: true
test-versions: 7.4-
paths: ${{ github.workspace }}/src

test-unit:
needs: [php-cs-check]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
dependency_version: [ prefer-stable ]

name: ${{ matrix.os }} - PHP ${{ matrix.php }} - ${{ matrix.dependency_version }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Install PHP dependencies
run: composer update --${{ matrix.dependency_version }} --no-interaction --prefer-dist --optimize-autoloader

- name: Run tests
run: ./vendor/bin/phpunit --testdox
42 changes: 27 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"prefer-stable": true,
"require": {
"json-mapper/json-mapper": "^2.21",
"symfony/event-dispatcher": "^7.0",
"symfony/filesystem": "^7.0",
"symfony/process": "^7.0",
"symfony/http-client": "^7.0",
"symfony/http-kernel": "^7.0",
"pimple/pimple": "^3.0",
"psr/simple-cache": "^3.0",
"opis/json-schema": "^2.3"
"json-mapper/json-mapper": "*",
"symfony/event-dispatcher": "*",
"symfony/filesystem": "*",
"symfony/process": "*",
"symfony/http-client": "*",
"symfony/http-kernel": "*",
"pimple/pimple": "*",
"psr/simple-cache": "*",
"opis/json-schema": "*"
},
"require-dev": {
"pestphp/pest": "^2.33",
"nette/php-generator": "^4.1",
"jane-php/json-schema": "^7.6",
"bamarni/composer-bin-plugin": "^1.8"
"phpunit/phpunit": "*",
"squizlabs/php_codesniffer":"*",
"nette/php-generator": "*",
"jane-php/json-schema": "*",
"bamarni/composer-bin-plugin": "*",
"wp-coding-standards/wpcs": "3.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true,
"bamarni/composer-bin-plugin": true
"bamarni/composer-bin-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"php": "7.4"
}
},
"autoload": {
"classmap": [
"src/"
],
"psr-4": {
"WordPress\\": "src/WordPress",
"Symfony\\Component\\Process\\": "vendor/symfony/process"
Expand All @@ -35,5 +44,8 @@
"src/WordPress/Zip/functions.php",
"src/WordPress/Streams/stream_str_replace.php"
]
},
"scripts": {
"phpcs": "phpcs --standard=WordPress"
}
}
Loading