Skip to content

Commit

Permalink
Use multi-tester GitHub Actions auto-detect for pug-php/pug
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Sep 17, 2023
1 parent d8e0a30 commit 30f7360
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4']
php: ['8.2']
setup: ['stable']

name: PHP
Expand All @@ -25,17 +25,19 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: memory_limit=-1, zend.enable_gc=0, xdebug.mode=coverage
tools: composer:v2
extensions: pcntl
coverage: xdebug

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-
${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-
- name: Code Climate Test Reporter Preparation
run: |
Expand All @@ -49,8 +51,8 @@ jobs:
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer config version 1.9.0
${{ matrix.php >= 8 && 'composer require --no-update phpunit/phpunit:^8.5.14 --no-interaction;' || '' }}
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php >= 8.1 && '--ignore-platform-req=php' || '' }}
composer require --no-update phpunit/phpunit:^9.6.12 phpunit/php-code-coverage:^9.2.28 --dev --no-interaction
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress --no-interaction
- name: Run test suite
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Multitest
name: Multi-test

on:
push:
Expand All @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
php: ['7.4', '8.0']
php: ['7.4', '8.2']
setup: ['stable']

name: PHP ${{ matrix.php }}
Expand All @@ -31,15 +31,15 @@ jobs:
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-multi-v2-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-multi-test-v2-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-multi-v2-${{ matrix.php }}-
${{ runner.os }}-multi-test-v2-${{ matrix.php }}-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer config version 1.9.0
composer require kylekatarnls/multi-tester:^2.3 --no-update --no-interaction
composer require kylekatarnls/multi-tester:^2.5.2 --dev --no-update --no-interaction
composer update --prefer-dist --prefer-${{ matrix.setup }} --no-progress --no-interaction
- name: Run test suites
Expand Down
9 changes: 6 additions & 3 deletions .multi-tester.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
pug-php/pug:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction
success_only: true
source:
url: git@github.com:pug-php/pug.git
reference: master
install: github
script: github

pug/bemto:
autoload:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"nodejs-php-fallback/uglify": "^1.0.4",
"nodejs-php-fallback/stylus": "^1.0.4",
"cebe/markdown": "^1.1",
"kylekatarnls/multi-tester": "^2.3"
"kylekatarnls/multi-tester": "^2.5.2"
},
"replace": {
"phug/ast": "self.version",
Expand Down
2 changes: 1 addition & 1 deletion release.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* php release.php minor stable message.md
* ```.
*
* Put release notes in message.md as markdown format.
* Put release notes in message.md as Markdown format.
*/
$settings = parse_ini_file('.env');

Expand Down
8 changes: 1 addition & 7 deletions src/Phug/Formatter/Formatter/Partial/MagicAccessorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ trait MagicAccessorTrait
{
private function getMethod($prefix, $name)
{
switch ($name) {
case 'nodes':
$name = 'children';
break;
}

return $prefix.ucfirst($name);
return $prefix.ucfirst($name === 'nodes' ? 'children' : $name);
}

public function __get($name)
Expand Down

0 comments on commit 30f7360

Please sign in to comment.