Skip to content

Commit 05248e0

Browse files
authored
Merge pull request #511 from defuse/try-to-re-enable-phar-build-on-ci
Re-enable phar building and testing on CI
2 parents 683b3cf + d65dca2 commit 05248e0

7 files changed

+49
-25
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ box.phar
99
phpunit.phar
1010
phpunit.phar.asc
1111
test/unit/File/tmp
12+
test/.phpunit.result.cache
1213
.idea

.travis.yml

+40-18
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,52 @@ matrix:
55
fast_finish: true
66
include:
77
- php: "5.6"
8-
env: USE_PSALM=0
8+
env:
9+
- USE_PSALM=0
10+
- BUILD_PHAR=0
911
- php: "7.0"
10-
env: USE_PSALM=0
12+
env:
13+
- USE_PSALM=0
14+
- BUILD_PHAR=0
1115
- php: "7.1"
12-
env: USE_PSALM=0
16+
env:
17+
- USE_PSALM=0
18+
- BUILD_PHAR=0
1319
- php: "7.2"
14-
env: USE_PSALM=0
20+
env:
21+
- USE_PSALM=0
22+
- BUILD_PHAR=0
1523
- php: "7.3"
16-
env: USE_PSALM=0
24+
env:
25+
- USE_PSALM=0
26+
- BUILD_PHAR=0
1727
- php: "7.4"
18-
env: USE_PSALM=1
28+
env:
29+
- USE_PSALM=1
30+
- BUILD_PHAR=0
1931
- php: "8.0"
2032
# psalm currently doesn't like our \[#SensitiveParameter]s
21-
env: USE_PSALM=0
33+
env:
34+
- USE_PSALM=0
35+
- BUILD_PHAR=0
2236
- php: "8.1"
2337
# psalm currently doesn't like our \[#SensitiveParameter]s
24-
env: USE_PSALM=0
38+
env:
39+
- USE_PSALM=0
40+
- BUILD_PHAR=1
2541
- php: "8.2"
26-
env: USE_PSALM=1
42+
env:
43+
- USE_PSALM=1
44+
- BUILD_PHAR=1
2745
dist: focal
2846
- php: "nightly"
29-
env: USE_PSALM=1
47+
env:
48+
- USE_PSALM=1
49+
- BUILD_PHAR=1
3050
- php: "hhvm"
31-
env: USE_PSALM=1
51+
env:
52+
- USE_PSALM=1
53+
- BUILD_PHAR=1
3254
allow_failures:
3355
- php: "nightly"
3456
- php: "hhvm"
@@ -42,13 +64,13 @@ before_script:
4264
- phpenv config-add extra_php_config.ini
4365
script:
4466
- ./test.sh
45-
# - mkdir /tmp/box
46-
# - chmod 755 /tmp/box
47-
# - curl -LSs https://github.com/box-project/box/releases/download/4.3.8/box.phar -o /tmp/box/box
48-
# - chmod 755 /tmp/box/box
49-
# - PATH="$PATH:/tmp/box/" which box
50-
# - PATH="$PATH:/tmp/box/" make -C dist/ build-phar
51-
# - ./test.sh dist/defuse-crypto.phar
67+
- if [[ $BUILD_PHAR -eq 1 ]]; then mkdir /tmp/box; fi
68+
- if [[ $BUILD_PHAR -eq 1 ]]; then chmod 755 /tmp/box; fi
69+
- if [[ $BUILD_PHAR -eq 1 ]]; then curl -LSs https://github.com/box-project/box/releases/download/4.3.8/box.phar -o /tmp/box/box; fi
70+
- if [[ $BUILD_PHAR -eq 1 ]]; then chmod 755 /tmp/box/box; fi
71+
- if [[ $BUILD_PHAR -eq 1 ]]; then PATH="$PATH:/tmp/box/" which box; fi
72+
- if [[ $BUILD_PHAR -eq 1 ]]; then PATH="$PATH:/tmp/box/" make -C dist/ build-phar; fi
73+
- if [[ $BUILD_PHAR -eq 1 ]]; then ./test.sh dist/phar-testing-autoload.php; fi
5274
- if [[ $USE_PSALM -eq 1 ]]; then composer require --with-all-dependencies --dev "vimeo/psalm:dev-master"; fi
5375
- if [[ $USE_PSALM -eq 1 ]]; then composer install; fi
5476
- if [[ $USE_PSALM -eq 1 ]]; then vendor/bin/psalm; fi

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"php": ">=5.6.0"
2727
},
2828
"require-dev": {
29-
"phpunit/phpunit": "^5|^6|^7|^8|^9|^10",
30-
"yoast/phpunit-polyfills": "^2.0.0"
29+
"yoast/phpunit-polyfills": "^2.0.0",
30+
"phpunit/phpunit": "^5|^6|^7|^8|^9|^10"
3131
},
3232
"bin": [
3333
"bin/generate-defuse-key"

dist/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ clean:
3131

3232
defuse-crypto.phar: dist/box.json composer.lock
3333
cp dist/box.json .
34-
php -d phar.readonly=0 $(box) build -c box.json -v
34+
php $(box) compile -c box.json -v
3535

3636
composer.lock:
3737
$(composer) config autoloader-suffix $(gitcommit)

dist/box.json

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"exclude": "other"
1616
}
1717
],
18-
"compactors": [
19-
"Herrera\\Box\\Compactor\\Php"
20-
],
2118
"main": "vendor/autoload.php",
2219
"output": "defuse-crypto.phar",
2320
"shebang": false,

dist/phar-testing-autoload.php

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
require 'defuse-crypto.phar';
3+
require realpath(dirname(__FILE__) . '/../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php');
4+
?>

docs/InternalDeveloperDocs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Test the `.phar`:
141141

142142
```
143143
cd ../
144-
./test.sh dist/defuse-crypto.phar
144+
./test.sh dist/phar-testing-autoload.php
145145
```
146146

147147
Sign the `.phar`:

0 commit comments

Comments
 (0)