Skip to content

Commit a44e0d9

Browse files
committed
fix ci
1 parent 1440b81 commit a44e0d9

13 files changed

+437
-367
lines changed

.editorconfig

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
root = true
2+
13
[*]
24
charset = utf-8
35
end_of_line = lf
@@ -12,6 +14,16 @@ ij_smart_tabs = false
1214
ij_visual_guides = none
1315
ij_wrap_on_typing = false
1416

17+
[{test/tmp/**,build/tmp/**}]
18+
ij_formatter_enabled = false
19+
generated_code = true
20+
charset = unset
21+
end_of_line = unset
22+
insert_final_newline = unset
23+
trim_trailing_whitespace = unset
24+
indent_style = unset
25+
indent_size = unset
26+
1527
[{*.json,composer.lock}]
1628
indent_size = 4
1729
indent_style = space
@@ -40,10 +52,9 @@ ij_yaml_space_before_colon = false
4052
ij_yaml_spaces_within_braces = true
4153
ij_yaml_spaces_within_brackets = true
4254

43-
[{*.php}]
55+
[*.php]
4456
indent_size = 4
4557
indent_style = space
46-
ij_continuation_indent_size = 4
4758
ij_php_align_assignments = false
4859
ij_php_align_class_constants = false
4960
ij_php_align_group_field_declarations = false
@@ -261,17 +272,7 @@ ij_php_version_weight = 28
261272
ij_php_while_brace_force = always
262273
ij_php_while_on_new_line = false
263274

264-
[{*.sh}]
265-
indent_size = 4
266-
tab_width = 4
267-
ij_shell_binary_ops_start_line = false
268-
ij_shell_keep_column_alignment_padding = false
269-
ij_shell_minify_program = false
270-
ij_shell_redirect_followed_by_space = false
271-
ij_shell_switch_cases_indented = false
272-
ij_shell_use_unix_line_separator = true
273-
274-
[{*.xml}]
275+
[*.xml]
275276
indent_size = 4
276277
indent_style = space
277278
ij_xml_align_attributes = true

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
COMPOSE_DOCKER_CLI_BUILD=1
22
DOCKER_BUILDKIT=1
3+
#DOCKER_DEFAULT_PLATFORM=linux/amd64
34
COMPOSE_PROJECT_NAME=app
45
COMPOSE_PATH_SEPARATOR=:
56
COMPOSE_FILE=build/docker-compose.yaml:build/docker-ci.yaml
7+
COMPOSE_PARALLEL_LIMIT=2

build/.gitlab-ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
2+
# include:
3+
# - template: Jobs/Container-Scanning.gitlab-ci.yml
4+
# container_scanning:
5+
# variables:
6+
# CS_IMAGE: $CI_REGISTRY_IMAGE:latest
7+
variables:
8+
APPNAME: "php-api-myrpc"
9+
REPONAME: "sshilko/php-api-myrpc"
10+
DOCKER_HOST: tcp://docker:2376
11+
DOCKER_TLS_CERTDIR: "/certs"
12+
COMPOSE_DOCKER_CLI_BUILD: 1
13+
DOCKER_BUILDKIT: 1
14+
COMPOSE_PARALLEL_LIMIT: 2
15+
16+
build-docker:
17+
image: docker:cli
18+
stage: build
19+
services:
20+
- docker:26.0.0-dind-alpine3.19
21+
timeout: 300 seconds
22+
before_script:
23+
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
24+
script:
25+
- docker pull $CI_REGISTRY_IMAGE:latest || true
26+
- docker tag $CI_REGISTRY_IMAGE:latest $REPONAME:latest || true
27+
- docker-compose build $APPNAME
28+
- docker-compose up $APPNAME -d
29+
- docker-compose exec $APPNAME composer install
30+
- docker-compose exec $APPNAME composer app-quality
31+
- docker-compose exec $APPNAME composer app-phpunit-coverage
32+
- docker-compose down
33+
# - docker tag $REPONAME:latest $CI_REGISTRY_IMAGE:latest
34+
# - docker push $CI_REGISTRY_IMAGE:latest
35+
# - |-
36+
# if [[ $CI_COMMIT_TAG != '' ]]; then
37+
# apk add curl && \
38+
# curl -v --header "Job-Token: ${CI_JOB_TOKEN}" --data tag=${CI_COMMIT_TAG} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/composer"
39+
# fi
40+
coverage: /^\s*Lines:\s*\d+.\d+\%/
41+
42+
artifacts:
43+
paths:
44+
- test/tmp/html/
45+
- build/tmp/phan-codeclimate-v1.json
46+
- build/tmp/pdepend-jdepend-chart.svg
47+
- build/tmp/pdepend-overview-pyramid.svg
48+
- build/tmp/phpcbf.txt
49+
- build/tmp/phpcs.txt
50+
- build/tmp/phpmd.txt
51+
- build/tmp/phpstan.txt
52+
- build/tmp/psalm-console.txt
53+
- test/tmp/phpunit-coverage-badge-classes.svg
54+
- test/tmp/phpunit-coverage-badge-methods.svg
55+
- test/tmp/phpunit-coverage-badge-lines.svg
56+
reports:
57+
junit: test/tmp/phpunit-junit.xml
58+
coverage_report:
59+
coverage_format: cobertura
60+
path: test/tmp/phpunit-cobertura.xml
61+
codequality: build/tmp/phan-codeclimate-v1.json

build/Dockerfile.php.common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ path-exclude /usr/share/linda/* \n\
3939
pre-commit \
4040
locales \
4141
netcat-traditional \
42+
jq \
4243
git && \
4344
apt-get clean && \
4445
apt-get -y autoremove && \

build/phpcs-ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<exclude name="SlevomatCodingStandard.Classes.ClassLength" />
6464
<exclude name="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion.DisallowedConstructorPropertyPromotion" />
6565
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName" />
66-
<exclude name="SlevomatCodingStandard.Files.FunctionLength" />
66+
<!-- <exclude name="SlevomatCodingStandard.Files.FunctionLength" /> -->
6767
<exclude name="SlevomatCodingStandard.Files.LineLength.LineTooLong" />
6868

6969
<exclude name="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature.RequiredMultiLineSignature" />

composer.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "sshilko/php-api-myrpc-beta",
33
"type": "library",
4+
"version": "1.0.0",
45
"description": "API facade in PHP for JSON RPC",
56
"license": "MIT",
67
"authors": [
@@ -88,13 +89,14 @@
8889
],
8990
"app-phpdoc": [
9091
"@putenv XDEBUG_MODE=off",
91-
"/usr/bin/phpdoc --config /app/build/phpdoc.xml"
92+
"/usr/bin/phpdoc --config /app/build/phpdoc.xml"
9293
],
9394
"app-phan": [
94-
"@putenv XDEBUG_MODE=off",
9595
"@putenv PHAN_DISABLE_XDEBUG_WARN=1",
9696
"@putenv PHAN_ALLOW_XDEBUG=1",
97-
"php ./vendor/bin/phan --load-baseline='./build/phan.baseline.php' --disable-plugins --color -k ./build/phan.php --output-mode html -o build/tmp/phan.html --long-progress-bar; cat build/tmp/phan.html"
97+
"php ./vendor/bin/phan --analyze-twice --load-baseline='./build/phan.baseline.php' --disable-plugins --no-color -k ./build/phan.php --long-progress-bar --output-mode codeclimate -o build/tmp/phan-codeclimate.json || echo 'Phan report saved'",
98+
"(tr '\\0' ',' < build/tmp/phan-codeclimate.json | sed 's/^/[/' | sed 's/,$/]/') > build/tmp/phan-codeclimate-v1.json",
99+
"cat build/tmp/phan-codeclimate-v1.json | jq"
98100
],
99101
"app-phan-baseline": [
100102
"@putenv XDEBUG_MODE=off",
@@ -131,9 +133,10 @@
131133
"php": ">=8.1",
132134
"ext-json": "*",
133135
"ext-pcntl": "*",
134-
"composer-plugin-api": "^2",
136+
"composer-plugin-api": ">=2.2.0",
137+
"composer-runtime-api": "^2",
135138
"psr/container": "^1.1",
136-
"psr/log": "^1",
139+
"psr/log": "^1 || ^2.0 || ^3.0",
137140
"symfony/property-access": "^6.4",
138141
"symfony/property-info": "^6.4",
139142
"symfony/serializer": "^6.4",
@@ -143,5 +146,10 @@
143146
"psr-4": {
144147
"myrpc\\": "src"
145148
}
149+
},
150+
"autoload-dev": {
151+
"psr-4": {
152+
"phpunit\\": "test/phpunit"
153+
}
146154
}
147155
}

0 commit comments

Comments
 (0)