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

Add support for building PHAR files and associated tests #40

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
23 changes: 23 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,33 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
tools: "phive"

- name: "Install dependencies (Composer)"
uses: "ramsey/[email protected]"

- name: "Run functional tests"
shell: "bash"
run: "composer test-functional"

- name: "Cleanup to prepare for PHAR tests"
shell: "bash"
run: |
rm -rf vendor/

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--no-dev"

- name: "Build PHAR file"
shell: "bash"
run: |
phive install humbug/box:"${{ matrix.php-version == '8.1' && '^4.1' || '^3.16' }}" --trust-gpg-keys 0x2DF45277AEF09A2F
./tools/box compile

- name: "Run functional tests on the phar file"
shell: "bash"
run: |
sed -i 's#\.\./\.\./bin/conventional-commits #../../bin/conventional-commits.phar #g' tests/expect/*.exp
composer test-functional
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
/phpcs.xml
/phpunit.xml
/vendor/
/.box_dump/
/bin/conventional-commits.phar
/tools/
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="humbug/box" version="^3.16 || ^4.1" installed="4.1.0" location="./tools/box" copy="false"/>
</phive>
3 changes: 3 additions & 0 deletions box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"files": ["schema.json"]
}