Skip to content

Commit

Permalink
Merge pull request #487 from ergebnis/feature/composer
Browse files Browse the repository at this point in the history
Enhancement: Install `phpunit/phpunit` for Phar tests with `composer`
  • Loading branch information
localheinz committed Feb 4, 2024
2 parents 514f790 + cf631df commit f1a2126
Show file tree
Hide file tree
Showing 8 changed files with 1,669 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/integrate.yaml
Expand Up @@ -209,7 +209,7 @@ jobs:
- name: "Install dependencies with phive"
uses: "ergebnis/.github/actions/phive/install@1.9.0"
with:
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D,0x4AA394086372C20A"
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D"

- name: "Validate configuration for humbug/box"
run: ".phive/box validate box.json --ansi"
Expand All @@ -220,8 +220,14 @@ jobs:
- name: "Show info about phpunit-slow-test-detector.phar with humbug/box"
run: ".phive/box info ${{ env.PHPUNIT_SLOW_TEST_DETECTOR_PHAR }} --ansi --list"

- name: "Install ${{ matrix.dependencies }} dependencies for running phar tests with composer"
uses: "ergebnis/.github/actions/composer/install@1.9.0"
with:
dependencies: "${{ matrix.dependencies }}"
working-directory: "test/Phar/Version10/"

- name: "Run phar tests with phpunit/phpunit"
run: ".phive/phpunit --colors=always --configuration=test/Phar/Version10/phpunit.xml"
run: "test/Phar/Version10/vendor/bin/phpunit --colors=always --configuration=test/Phar/Version10/phpunit.xml"

dependency-analysis:
name: "Dependency Analysis"
Expand Down Expand Up @@ -274,7 +280,7 @@ jobs:
- name: "Install dependencies with phive"
uses: "ergebnis/.github/actions/phive/install@1.9.0"
with:
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D,0x4AA394086372C20A"
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D"

- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -69,7 +69,7 @@ jobs:
- name: "Install dependencies with phive"
uses: "ergebnis/.github/actions/phive/install@1.9.0"
with:
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D,0x4AA394086372C20A"
trust-gpg-keys: "0x2DF45277AEF09A2F,0x033E5F8D801A2F8D"

- name: "Validate configuration for humbug/box"
run: ".phive/box validate box.json --ansi"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
/.build/
/.note/
/.phive/
/test/Phar/Version10/vendor/
/vendor/
!/.phive/phars.xml
1 change: 0 additions & 1 deletion .phive/phars.xml
Expand Up @@ -2,5 +2,4 @@
<phive xmlns="https://phar.io/phive">
<phar name="humbug/box" version="^4.4.0" installed="4.4.0" location="./.phive/box" copy="false"/>
<phar name="composer-require-checker" version="~3.8.0" installed="3.8.0" location="./.phive/composer-require-checker" copy="false"/>
<phar name="phpunit" version="^10.4.1" installed="10.4.1" location="./.phive/phpunit" copy="false"/>
</phive>
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -27,11 +27,12 @@ phar: phive ## Builds a phar with humbug/box
.phive/box compile --config=box.json
git checkout HEAD -- composer.json composer.lock
.phive/box info .build/phar/phpunit-slow-test-detector.phar --list
.phive/phpunit --configuration=test/Phar/Version10/phpunit.xml
composer install --no-interaction --no-progress --working-dir=test/Phar/Version10/
test/Phar/Version10/vendor/bin/phpunit --configuration=test/Phar/Version10/phpunit.xml

.PHONY: phive
phive: .phive ## Installs dependencies with phive
PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0x2DF45277AEF09A2F,0x033E5F8D801A2F8D,0x4AA394086372C20A
PHIVE_HOME=.build/phive phive install --trust-gpg-keys=0x2DF45277AEF09A2F,0x033E5F8D801A2F8D

.PHONY: refactoring
refactoring: vendor ## Runs automated refactoring with rector/rector
Expand Down
15 changes: 15 additions & 0 deletions test/Phar/Version10/composer.json
@@ -0,0 +1,15 @@
{
"require": {
"php": "~8.1.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0.0"
},
"config": {
"platform": {
"php": "8.1.27"
},
"preferred-install": "dist",
"sort-packages": true
}
}

0 comments on commit f1a2126

Please sign in to comment.