Skip to content

Commit 1bff085

Browse files
committedJul 29, 2022
Use our standardized ci setup
1 parent cb264fa commit 1bff085

10 files changed

+3895
-262
lines changed
 

‎.github/dependabot.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
version: 2
22
updates:
3-
- package-ecosystem: composer
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

‎.github/workflows/integrate.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# https://docs.github.com/en/actions
2+
3+
name: "Integrate"
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches:
8+
- "5.x"
9+
pull_request: null
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch: null
12+
13+
jobs:
14+
code-coverage:
15+
name: "Code Coverage"
16+
uses: "phpDocumentor/.github/.github/workflows/code-coverage.yml@main"
17+
with:
18+
composer-root-version: "2.x-dev"
19+
20+
coding-standards:
21+
name: "Coding Standards"
22+
uses: "phpDocumentor/.github/.github/workflows/coding-standards.yml@v0.1.0"
23+
with:
24+
composer-root-version: "2.x-dev"
25+
26+
dependency-analysis:
27+
name: "Dependency analysis"
28+
uses: "phpDocumentor/.github/.github/workflows/dependency-analysis.yml@v0.1.0"
29+
with:
30+
composer-root-version: "2.x-dev"
31+
32+
lint-root:
33+
name: "Lint root"
34+
uses: "phpDocumentor/.github/.github/workflows/lint.yml@main"
35+
with:
36+
composer-options: "--no-check-publish --ansi"
37+
38+
static-analysis:
39+
name: "Static analysis"
40+
uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@v0.1.0"
41+
with:
42+
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix"
43+
composer-root-version: "2.x-dev"
44+
45+
unit-tests:
46+
name: "Unit test"
47+
uses: "phpDocumentor/.github/.github/workflows/continues-integration.yml@v0.1.0"
48+
with:
49+
composer-root-version: "2.x-dev"

‎.github/workflows/push.yml

-194
This file was deleted.

‎Makefile

+33-29
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
1-
.PHONY: install-phive
2-
install-phive:
3-
mkdir tools; \
4-
wget -O tools/phive.phar https://phar.io/releases/phive.phar; \
5-
wget -O tools/phive.phar.asc https://phar.io/releases/phive.phar.asc; \
6-
gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \
7-
gpg --verify tools/phive.phar.asc tools/phive.phar; \
8-
chmod +x tools/phive.phar
9-
10-
.PHONY: setup
11-
setup: install-phive
12-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phar-ga:latest php tools/phive.phar install --force-accept-unsigned
13-
14-
.PHONY: phpcs
15-
phpcs:
16-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -s
17-
18-
.PHONY: phpcbf
19-
phpcbf:
1+
.PHONY: help
2+
help: ## Displays this list of targets with descriptions
3+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
4+
5+
.PHONY: code-style
6+
code-style:
7+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -d memory_limit=1024M -s
8+
9+
.PHONY: fix-code-style
10+
fix-code-style:
2011
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest phpcbf
2112

22-
.PHONY: phpstan
23-
phpstan:
24-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpstan-ga:latest analyse src --no-progress --configuration phpstan.neon
13+
.PHONY: static-code-analysis
14+
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm
15+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpstan --configuration=phpstan.neon
16+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/psalm
2517

26-
.PHONY: psalm
27-
psalm:
28-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.3 vendor/bin/psalm.phar
2918
.PHONY: test
30-
test:
31-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/phpunit
19+
test: test-unit ## Runs all test suites with phpunit/phpunit
20+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpunit
3221

33-
.PHONY: pre-commit-test
34-
pre-commit-test: test phpcs phpstan psalm
22+
.PHONY: test-unit
23+
test-unit: ## Runs unit tests with phpunit/phpunit
24+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/phpunit --testsuite=unit
25+
26+
.PHONY: dependency-analysis
27+
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
28+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 .phive/composer-require-checker check --config-file=/opt/project/composer-require-checker.json
3529

30+
vendor: composer.json composer.lock
31+
composer validate --no-check-publish
32+
composer install --no-interaction --no-progress
33+
34+
.PHONY: rector
35+
rector: ## Refactor code using rector
36+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.4 vendor/bin/rector process
37+
38+
.PHONY: pre-commit-test
39+
pre-commit-test: fix-code-style test code-style static-code-analysis

‎composer.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,34 @@
44
"homepage": "https://www.phpdoc.org",
55
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
66
"license": "MIT",
7+
"minimum-stability": "stable",
78
"authors": [
89
{
910
"name": "Jaap van Otterdijk",
1011
"email": "opensource@ijaap.nl"
1112
}
1213
],
1314
"require": {
14-
"php": "^7.3 || ^8.0"
15+
"php": "^7.4 || ^8.0"
1516
},
1617
"autoload" : {
1718
"psr-4" : {
1819
"phpDocumentor\\Reflection\\": "src/"
1920
}
2021
},
21-
"require-dev": {
22-
"psalm/phar": "^4.8"
23-
},
2422
"extra": {
2523
"branch-alias": {
2624
"dev-2.x": "2.x-dev"
2725
}
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit": "^9.5",
29+
"phpstan/phpstan": "^1.8",
30+
"vimeo/psalm": "^4.25"
31+
},
32+
"config": {
33+
"platform": {
34+
"php": "7.4.1"
35+
}
2836
}
2937
}

0 commit comments

Comments
 (0)