Skip to content

Commit 140c6ea

Browse files
committed
use composer installed tools
With a new stable, we now can use the composer installed tools and do not need to rely on the setup-php action to provide them. This ensures github and local tool use is in sync.
1 parent 010ed07 commit 140c6ea

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

.github/workflows/autofix.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ jobs:
1717
autofix:
1818
name: Automatic Code Style Fixing
1919
runs-on: ubuntu-latest
20+
2021
if: |
2122
contains(fromJSON('["refs/heads/master", "refs/heads/main", "refs/heads/devel"]'), github.ref) &&
2223
( github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository )
24+
25+
env:
26+
COMPOSER: _test/composer.json
27+
COMPOSER_VENDOR_DIR: _test/vendor
28+
2329
steps:
2430
- name: Checkout
2531
uses: actions/checkout@v4
@@ -29,7 +35,6 @@ jobs:
2935
with:
3036
php-version: 8.2
3137
extensions: mbstring, intl, PDO, pdo_sqlite, bz2
32-
tools: phpcbf, rector
3338

3439
- name: Create DokuWiki Environment
3540
id: dokuwiki-env
@@ -38,18 +43,16 @@ jobs:
3843
branch: master
3944

4045
- name: Install Composer Dependencies
41-
run: |
42-
cd _test
43-
composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader --no-scripts
46+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-scripts
4447

4548
- name: Run Rector (PHP ${{ inputs.rector-php }})
4649
env:
4750
RECTOR_MIN_PHP: ${{ inputs.rector-php }}
48-
run: rector process --config _test/rector.php --no-diffs ${{ steps.dokuwiki-env.outputs.dir }}
51+
run: composer exec -- rector process --config _test/rector.php --no-diffs ${{ steps.dokuwiki-env.outputs.dir }}
4952

5053
- name: Run PHP CodeSniffer AutoFixing
5154
continue-on-error: true # even if not all errors are fixed, we want to create a PR
52-
run: phpcbf --standard=_test/phpcs.xml ${{ steps.dokuwiki-env.outputs.dir }}
55+
run: composer exec -- phpcbf --standard=_test/phpcs.xml ${{ steps.dokuwiki-env.outputs.dir }}
5356

5457
- name: Create Pull Request
5558
uses: peter-evans/create-pull-request@v4

.github/workflows/cs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ jobs:
1010
phpcs:
1111
name: PHP CodeSniffer
1212
runs-on: ubuntu-latest
13+
1314
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
15+
16+
env:
17+
COMPOSER: _test/composer.json
18+
COMPOSER_VENDOR_DIR: _test/vendor
19+
1420
steps:
1521
- name: Checkout
1622
uses: actions/checkout@v4
@@ -20,7 +26,6 @@ jobs:
2026
with:
2127
php-version: 8.2
2228
extensions: mbstring, intl, PDO, pdo_sqlite, bz2
23-
tools: phpcs
2429

2530
- name: Create DokuWiki Environment
2631
id: dokuwiki-env
@@ -29,9 +34,7 @@ jobs:
2934
branch: master
3035

3136
- name: Install Composer Dependencies
32-
run: |
33-
cd _test
34-
composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader --no-scripts
37+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-scripts
3538

3639
- name: Run PHP codesniffer
37-
run: phpcs -q --standard=_test/phpcs.xml ${{ steps.dokuwiki-env.outputs.dir }}
40+
run: composer exec -- phpcs -q --standard=_test/phpcs.xml ${{ steps.dokuwiki-env.outputs.dir }}

.github/workflows/test.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
2121

22+
env:
23+
COMPOSER: _test/composer.json
24+
COMPOSER_VENDOR_DIR: _test/vendor
25+
2226
strategy:
2327
matrix: ${{ fromJson(inputs.matrix-json) }}
2428
fail-fast: false
@@ -45,25 +49,10 @@ jobs:
4549
branch: ${{ matrix.dokuwiki-branch }}
4650

4751
- name: Install Composer Dependencies
48-
run: |
49-
cd _test
50-
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-scripts
51-
52-
- name: Setup PHPUnit
53-
run: |
54-
if [ -f _test/fetchphpunit.php ]; then
55-
php _test/fetchphpunit.php
56-
fi
52+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-scripts
5753

5854
- name: Check Syntax
59-
run: |
60-
find ${{ steps.dokuwiki-env.outputs.dir }} -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0L1 php -l
55+
run: find ${{ steps.dokuwiki-env.outputs.dir }} -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0L1 php -l
6156

6257
- name: Run PHPUnit
63-
run: |
64-
cd _test
65-
if [ -f phpunit.phar ]; then
66-
php phpunit.phar --verbose --stderr --group ${{ steps.dokuwiki-env.outputs.type }}_${{ steps.dokuwiki-env.outputs.base }}
67-
else
68-
composer exec -- phpunit --verbose --stderr --group ${{ steps.dokuwiki-env.outputs.type }}_${{ steps.dokuwiki-env.outputs.base }}
69-
fi
58+
run: composer exec -- phpunit -c _test/phpunit.xml --verbose --stderr --group ${{ steps.dokuwiki-env.outputs.type }}_${{ steps.dokuwiki-env.outputs.base }}

0 commit comments

Comments
 (0)