Skip to content

Commit e7968b9

Browse files
Use phive instead of polluting dependencies (#103)
* Move some things to phive * ensure tools are updated * Ensure tools exist * Install phive if it doesn't exist * Specify the keys to trust * check installation * Use shell semantics * Fix tools * Now use tools directory * Use phpunit * Update to latest rc
1 parent 782eb94 commit e7968b9

File tree

6 files changed

+843
-2336
lines changed

6 files changed

+843
-2336
lines changed

.github/workflows/php.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ jobs:
1616
with:
1717
php-version: 8.0
1818
extensions: xdebug
19-
- name: Validate composer.json and composer.lock
20-
run: composer validate
19+
- name: Validate composer.json and install tools
20+
run: |
21+
composer validate
22+
make tools
2123
2224
- name: Cache Composer packages
2325
id: composer-cache
@@ -50,7 +52,7 @@ jobs:
5052
php-version: 8.0
5153
extensions: xdebug
5254
- name: Validate composer.json and composer.lock
53-
run: composer validate
55+
run: composer validate && make tools
5456

5557
- name: Cache Composer packages
5658
id: composer-cache
@@ -129,7 +131,7 @@ jobs:
129131
timeout-minutes: 5
130132
strategy:
131133
matrix:
132-
dapr-version: [ 1.3.0-rc.1, 1.2.0, 1.2.1, 1.2.2 ]
134+
dapr-version: [ 1.3.0-rc.4, 1.2.0, 1.2.1, 1.2.2 ]
133135
steps:
134136
- name: Download Caddy Image
135137
uses: actions/download-artifact@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/.idea/
55
.phpunit.result.cache
66
coverage.xml
7+
/tools/

.phive/phars.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="psalm" version="^4.7" installed="4.8.1" location="./tools/psalm" copy="false"/>
4+
</phive>

Makefile

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
export GITHUB_SHA=latest
33
export DAPR_VERSION=1.3.0-rc.1
44

5+
PHIVE=$(shell which phive || echo .phive/phive)
6+
57
.PHONY: integration-tests
6-
integration-tests: build
8+
integration-tests: build tools
79
docker-compose down -v
810
docker-compose up &
911
sleep 10
@@ -28,3 +30,16 @@ build-tests: vendor/autoload.php
2830
.PHONY: build-caddy
2931
build-caddy: vendor/autoload.php
3032
docker build -t caddy:latest -f images/caddy.Dockerfile .
33+
34+
$(PHIVE):
35+
wget -O phive.phar "https://phar.io/releases/phive.phar"
36+
wget -O phive.phar.asc "https://phar.io/releases/phive.phar.asc"
37+
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79
38+
gpg --verify phive.phar.asc phive.phar
39+
rm phive.phar.asc
40+
chmod +x phive.phar
41+
mv phive.phar $(PHIVE)
42+
43+
tools: .phive/phars.xml $(PHIVE)
44+
rm -rf tools && echo $(PHIVE)
45+
$(PHIVE) install --trust-gpg-keys 12CE0F1D262429A5,4AA394086372C20A

composer.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
},
2828
"require-dev": {
2929
"ext-xdebug": "*",
30-
"phpunit/phpunit": "^9",
31-
"vimeo/psalm": "^4.7"
30+
"phpunit/phpunit": "^9"
3231
},
3332
"autoload": {
3433
"psr-4": {
@@ -52,6 +51,6 @@
5251
"integration-tests": [
5352
"curl localhost:9502/do_tests"
5453
],
55-
"lint": "./vendor/bin/psalm"
54+
"lint": "./tools/psalm"
5655
}
5756
}

0 commit comments

Comments
 (0)