Skip to content
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

Enhancement: Install phpunit/phpunit for Phar tests with composer #487

Merged
merged 1 commit into from
Feb 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
12 changes: 9 additions & 3 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.build/
/.note/
/.phive/
/test/Phar/Version10/vendor/
/vendor/
!/.phive/phars.xml
1 change: 0 additions & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Loading