Skip to content
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
5 changes: 5 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exclude_paths:
- ".github/**"
- "example/**"
- "test/**"

109 changes: 58 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: CI

on: [push]
on:
push:
pull_request:

permissions:
contents: read
actions: read

jobs:
composer:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v6
Expand All @@ -22,6 +28,7 @@ jobs:
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: pcntl

- name: Archive build
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
Expand All @@ -37,7 +44,7 @@ jobs:
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

outputs:
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
Expand Down Expand Up @@ -72,7 +79,7 @@ jobs:
needs: [ phpunit ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -95,7 +102,7 @@ jobs:
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -114,52 +121,52 @@ jobs:
level: 6
memory_limit: 256M

# phpmd:
# runs-on: ubuntu-latest
# needs: [ composer ]
# strategy:
# matrix:
# php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
#
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: build-artifact-${{ matrix.php }}
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - name: PHP Mess Detector
# uses: php-actions/phpmd@v1
# with:
# php_version: ${{ matrix.php }}
# path: src/
# output: text
# ruleset: phpmd.xml
#
# phpcs:
# runs-on: ubuntu-latest
# needs: [ composer ]
# strategy:
# matrix:
# php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
#
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: build-artifact-${{ matrix.php }}
# path: /tmp/github-actions
#
# - name: Extract build archive
# run: tar -xvf /tmp/github-actions/build.tar ./
#
# - name: PHP Code Sniffer
# uses: php-actions/phpcs@v1
# with:
# php_version: ${{ matrix.php }}
# path: src/
# standard: phpcs.xml
phpmd:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Mess Detector
uses: php-actions/phpmd@v1
with:
php_version: ${{ matrix.php }}
path: src/
output: text
ruleset: phpmd.xml

phpcs:
Comment thread Fixed
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Code Sniffer
uses: php-actions/phpcs@v1
with:
php_version: ${{ matrix.php }}
path: src/
standard: phpcs.xml

remove_old_artifacts:
runs-on: ubuntu-latest
Expand Down
22 changes: 19 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"description": "Bind dynamic data to reusable HTML components.",
"license": "MIT",
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-dom": "*",
"phpgt/dom": "^4.1.9"
},
"require-dev": {
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^10.0"
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5",
"squizlabs/php_codesniffer": "^4.0",
"phpmd/phpmd": "^2.15"
},

"autoload": {
Expand All @@ -23,6 +25,20 @@
}
},

"scripts": {
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
"phpunit:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text",
"phpstan": "vendor/bin/phpstan analyse --level 6 src --memory-limit 256M",
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
"test": [
"@phpunit",
"@phpstan",
"@phpcs",
"@phpmd"
]
},

"funding": [
{
"type": "github",
Expand Down
Loading
Loading