Skip to content

Commit 663ee4d

Browse files
committed
Build phar with Box
1 parent 746d631 commit 663ee4d

6 files changed

Lines changed: 52 additions & 16 deletions

File tree

.github/workflows/lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,18 @@ jobs:
2828
- uses: ramsey/composer-install@v3
2929

3030
- run: vendor/bin/phpstan analyse --error-format=github
31+
32+
box:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v5
36+
with:
37+
fetch-depth: 0
38+
39+
- uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: '8.4'
42+
coverage: none
43+
tools: box:4
44+
45+
- run: box validate

.github/workflows/test.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,29 @@ jobs:
5454
files: coverage-unit.xml
5555
flags: unit
5656

57-
bin:
58-
runs-on: ubuntu-latest
59-
env:
60-
GOFLAGS: '-mod=mod'
57+
phar:
58+
runs-on: ubuntu-24.04
59+
outputs:
60+
php-version: ${{ steps.setup-php.outputs.php-version }}
6161
steps:
6262
- uses: actions/checkout@v5
63+
with:
64+
fetch-depth: 0
6365

6466
- uses: shivammathur/setup-php@v2
67+
id: setup-php
6568
with:
6669
php-version: '8.4'
6770
coverage: none
71+
tools: box:4
6872
- uses: ramsey/composer-install@v3
6973
with:
70-
composer-options: '--no-dev --prefer-dist'
74+
composer-options: --no-dev --prefer-dist
7175

72-
- name: Add bin into PATH
73-
run: echo "${WORKSPACE}/bin" >> "$GITHUB_PATH"
74-
env:
75-
WORKSPACE: ${{ github.workspace }}
76+
- run: box compile
7677

77-
- uses: actions/setup-go@v6
78+
- uses: actions/upload-artifact@v4
7879
with:
79-
go-version-file: 'go.mod'
80-
81-
- name: Print php-matrix binary path
82-
run: go test -count=1 -v ./internal
83-
84-
- run: go test -count=1 ./...
80+
name: php-matrix.phar
81+
path: phar/php-matrix
82+
if-no-files-found: error

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
# Composer
12
/vendor/
3+
4+
# Pest
25
/coverage*.xml
6+
7+
# Box
8+
/phar/

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ vendor:
1010

1111
bin: vendor
1212

13+
phar: vendor
14+
box compile
15+
box verify phar/php-matrix
16+
box info phar/php-matrix
17+
php phar/php-matrix --version
18+
1319
test-%: %
1420
PATH="$(shell pwd)/$*:$(shell echo $$PATH)" \
1521
go test -count=1 ./...

box.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"output": "phar/php-matrix",
3+
"check-requirements": false,
4+
"files-bin": [
5+
"data/all-versions.json"
6+
],
7+
"datetime": "datetime",
8+
"datetime-format": "Y-m-d",
9+
"git-tag": "git-tag"
10+
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
},
6565
"scripts": {
6666
"lint": [
67+
"box validate",
6768
"pint --test",
6869
"phpstan analyse"
6970
],

0 commit comments

Comments
 (0)