Skip to content

Commit 5945ddc

Browse files
authored
Merge branch 'master' into feature/repman-http-proxy
2 parents e4b0944 + 6819f07 commit 5945ddc

File tree

55 files changed

+2238
-1828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2238
-1828
lines changed

.dockerignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
/tests
88
/var/*
99

10-
###> friendsofphp/php-cs-fixer ###
11-
/.php_cs
12-
/.php_cs.cache
13-
/.php_cs.dist
14-
###< friendsofphp/php-cs-fixer ###
10+
###> php-cs-fixer/shim ###
11+
/.php-cs-fixer.cache
12+
/.php-cs-fixer.dist.php
13+
###< php-cs-fixer/shim ###
1514

1615
###> phpunit/phpunit ###
1716
/phpunit.xml

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ max_line_length = 160
99
end_of_line = lf
1010
insert_final_newline = true
1111
trim_trailing_whitespace = true
12+
13+
[*.{yml,yaml}]
14+
indent_size = 2

.gitattributes

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
* text=auto
22

3-
/ansible export-ignore
4-
/bin/coverage-checker export-ignore
5-
/docker export-ignore
6-
/tests export-ignore
7-
/.codecov.yml export-ignore
8-
/.dockerignore export-ignore
9-
/.env.docker export-ignore
10-
/.env.test export-ignore
11-
/.gitattributes export-ignore
12-
/.gitignore export-ignore
13-
/.php_cs.dist export-ignore
14-
/buddy.yml export-ignore
15-
/docker-compose.yml export-ignore
16-
/Dockerfile export-ignore
17-
/phpstan.neon export-ignore
18-
/phpunit.xml.dist export-ignore
3+
/ansible export-ignore
4+
/bin/coverage-checker export-ignore
5+
/docker export-ignore
6+
/tests export-ignore
7+
/.codecov.yml export-ignore
8+
/.dockerignore export-ignore
9+
/.env.docker export-ignore
10+
/.env.test export-ignore
11+
/.gitattributes export-ignore
12+
/.gitignore export-ignore
13+
/.php-cs-fixer.dist.php export-ignore
14+
/buddy.yml export-ignore
15+
/docker-compose.yml export-ignore
16+
/Dockerfile export-ignore
17+
/phpstan.neon export-ignore
18+
/phpunit.xml.dist export-ignore

.github/workflows/security.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
schedule:
3+
- cron: '0 12 * * *'
4+
workflow_dispatch:
5+
6+
jobs:
7+
job:
8+
name: "Security"
9+
runs-on: "ubuntu-latest"
10+
11+
steps:
12+
- name: "Checkout"
13+
uses: "actions/checkout@v4"
14+
with:
15+
show-progress: false
16+
17+
- name: "Setup PHP"
18+
uses: "shivammathur/setup-php@v2"
19+
with:
20+
php-version: '7.4.2'
21+
22+
- name: "Run composer audit"
23+
run: "composer audit --no-dev --locked"

.github/workflows/tests.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: "Tests"
2+
3+
concurrency:
4+
group: "tests-${{ github.head_ref || github.run_id }}"
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
push:
10+
branches: [master]
11+
12+
jobs:
13+
tests:
14+
name: "PHP ${{ matrix.php }} | PostgreSQL ${{ matrix.postgresql }}"
15+
runs-on: "ubuntu-latest"
16+
container:
17+
image: "php:${{ matrix.php-version }}-cli-alpine"
18+
env:
19+
DATABASE_URL: "postgresql://main:main@postgresql:5432/main?serverVersion=${{ matrix.postgresql }}&charset=utf8"
20+
services:
21+
postgresql:
22+
image: "postgres:${{ matrix.postgresql-version }}-alpine"
23+
env:
24+
POSTGRES_USER: main
25+
POSTGRES_PASSWORD: main
26+
POSTGRES_DB: main
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
php:
32+
- "7.4"
33+
- "8.0"
34+
postgresql:
35+
- "11"
36+
include:
37+
- php: "7.4"
38+
php-version: "7.4.2"
39+
- php: "8.0"
40+
php-version: "8.0.30"
41+
- postgresql: "11"
42+
postgresql-version: "11.7"
43+
44+
steps:
45+
- name: "Install OS dependencies"
46+
run: "apk add --no-cache bash git"
47+
48+
- name: "Adjust allowed PHP memory"
49+
run: echo 'memory_limit = -1' > $PHP_INI_DIR/conf.d/memory-limit.ini;
50+
51+
- name: "Install PHP extensions"
52+
shell: bash
53+
run: |
54+
wget https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions --quiet -O /usr/local/bin/install-php-extensions
55+
chmod +x /usr/local/bin/install-php-extensions
56+
install-php-extensions intl pdo_pgsql zip
57+
58+
- name: "Install composer"
59+
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=2.6.6
60+
61+
- name: "Checkout"
62+
uses: "actions/checkout@v4"
63+
with:
64+
ref: ${{ github.event.pull_request.head.ref || '' }}
65+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
66+
show-progress: false
67+
68+
- name: "Install composer dependencies"
69+
uses: "ramsey/composer-install@v2"
70+
71+
- name: "Validate composer dependencies"
72+
run: "composer validate"
73+
74+
- name: "Run composer audit"
75+
run: "composer audit --no-dev --locked"
76+
77+
- name: "Check code style"
78+
run: "composer check-cs"
79+
80+
- name: "Run PHPStan"
81+
run: "composer phpstan"
82+
83+
- name: "Lint twig"
84+
run: "bin/console lint:twig templates --show-deprecations"
85+
86+
- name: "Run migrations"
87+
run: "bin/console doctrine:migrations:migrate --no-interaction"
88+
89+
- name: "Setup messenger transports"
90+
run: "bin/console messenger:setup-transports"
91+
92+
- name: "Validate database schema"
93+
run: "bin/console doctrine:schema:validate"
94+
95+
- name: "Set git committer info and configure git options"
96+
shell: bash
97+
run: |
98+
git config --global user.name "${GITHUB_ACTOR}"
99+
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
100+
git config --global --add safe.directory '*'
101+
102+
- name: "Run unit tests"
103+
run: "composer phpunit:unit"
104+
105+
- name: "Run integration tests"
106+
run: "composer phpunit:integration"
107+
108+
- name: "Run functional tests"
109+
run: "composer phpunit:functional"
110+
111+
- name: "Warmup prod cache"
112+
run: "bin/console cache:warmup --env=prod"

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
!/var/.gitkeep
99
/vendor/
1010
###< symfony/framework-bundle ###
11-
12-
###> friendsofphp/php-cs-fixer ###
13-
/.php_cs
14-
/.php_cs.cache
15-
###< friendsofphp/php-cs-fixer ###
16-
1711
###> phpunit/phpunit ###
1812
/phpunit.xml
1913
.phpunit.result.cache
@@ -42,3 +36,8 @@ docker-compose.*.yml
4236
###< Docker ###
4337

4438
composer.phar
39+
40+
###> php-cs-fixer/shim ###
41+
/.php-cs-fixer.php
42+
/.php-cs-fixer.cache
43+
###< php-cs-fixer/shim ###

.php-cs-fixer.dist.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
$config = new PhpCsFixer\Config();
99
return $config->setRiskyAllowed(true)
1010
->setRules([
11-
'@PHP71Migration' => true,
11+
'@PHP74Migration' => true,
1212
'@Symfony' => true,
1313
'array_syntax' => ['syntax' => 'short'],
14+
'blank_line_between_import_groups' => false,
1415
'no_superfluous_elseif' => true,
1516
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
1617
'no_unreachable_default_argument_value' => true,
@@ -19,7 +20,7 @@
1920
'no_unused_imports' => true,
2021
'declare_strict_types' => true,
2122
'ordered_imports' => [
22-
'imports_order' => null,
23+
'imports_order' => ['class', 'function', 'const'],
2324
'sort_algorithm' => 'alpha',
2425
],
2526
'phpdoc_order' => true,

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4.5-fpm-alpine
1+
FROM php:8.0.19-fpm-alpine
22

33
ARG TIMEZONE="UTC"
44

buddy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
type: "BUILD"
1010
working_directory: "/buddy/repman"
1111
docker_image_name: "library/php"
12-
docker_image_tag: "7.4.1"
12+
docker_image_tag: "8.0.19"
1313
execute_commands:
1414
- "composer validate"
1515
- "composer install"
@@ -83,7 +83,7 @@
8383
type: "BUILD"
8484
working_directory: "/buddy/repman"
8585
docker_image_name: "library/php"
86-
docker_image_tag: "7.4.1"
86+
docker_image_tag: "8.0.19"
8787
execute_commands:
8888
- "/local-php-security-checker"
8989
setup_commands:

composer.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"license": "MIT",
1717
"require": {
18-
"php": "^7.4.1",
18+
"php": "^7.4.2 || ^8.0",
1919
"ext-ctype": "*",
2020
"ext-curl": "*",
2121
"ext-iconv": "*",
@@ -25,7 +25,7 @@
2525
"ext-zip": "*",
2626
"async-aws/ses": "^1.4",
2727
"bitbucket/client": "^4.0",
28-
"buddy-works/buddy-works-php-api": "1.3.0",
28+
"buddy-works/buddy-works-php-api": "^1.3",
2929
"buddy-works/oauth2-client": "^1.0",
3030
"cbschuld/browser.php": "^1.9",
3131
"clue/mq-react": "^1.2",
@@ -46,11 +46,12 @@
4646
"munusphp/munus": "^0.4.0",
4747
"nelmio/api-doc-bundle": "^4.3",
4848
"nelmio/cors-bundle": "^2.1",
49+
"nyholm/psr7": "^1.5",
4950
"omines/oauth2-gitlab": "^3.2",
5051
"ramsey/uuid-doctrine": "^1.5",
5152
"react/http": "^1.0",
5253
"sensio/framework-extra-bundle": "^5.5",
53-
"sentry/sentry-symfony": "^3.4",
54+
"sentry/sentry-symfony": "^4.0",
5455
"stevenmaguire/oauth2-bitbucket": "^3.0",
5556
"symfony/amazon-mailer": "5.4.*",
5657
"symfony/asset": "5.4.*",
@@ -87,14 +88,14 @@
8788
"symfony/symfony": "*"
8889
},
8990
"require-dev": {
90-
"coduo/php-matcher": "^4.0",
91+
"coduo/php-matcher": "^6.0",
9192
"dama/doctrine-test-bundle": "^6.3",
9293
"doctrine/doctrine-fixtures-bundle": "^3.3",
9394
"ekino/phpstan-banned-code": "^1.0.0",
9495
"fakerphp/faker": "^1.9",
95-
"friendsofphp/php-cs-fixer": "^2.16",
9696
"johnkary/phpunit-speedtrap": "^4.0",
9797
"league/flysystem-memory": "^1.0",
98+
"php-cs-fixer/shim": "^3.9",
9899
"phpspec/prophecy-phpunit": "^2.0",
99100
"phpstan/extension-installer": "^1.0",
100101
"phpstan/phpstan": "^1.3.0",
@@ -110,6 +111,9 @@
110111
"symfony/web-profiler-bundle": "*"
111112
},
112113
"config": {
114+
"platform": {
115+
"php": "7.4.2"
116+
},
113117
"preferred-install": {
114118
"*": "dist"
115119
},
@@ -118,6 +122,9 @@
118122
"composer/package-versions-deprecated": true,
119123
"phpstan/extension-installer": true,
120124
"symfony/flex": true
125+
},
126+
"audit": {
127+
"abandoned": "report"
121128
}
122129
},
123130
"extra": {
@@ -164,10 +171,21 @@
164171
],
165172
"phpstan": [
166173
"bin/console cache:clear --env=test",
167-
"phpstan analyse --level=max"
174+
"phpstan analyse --level=max --memory-limit=-1"
168175
],
169176
"phpunit": [
170-
"phpunit --colors=always"
177+
"@phpunit:unit",
178+
"@phpunit:integration",
179+
"@phpunit:functional"
180+
],
181+
"phpunit:unit": [
182+
"phpunit --colors=always --testsuite=unit"
183+
],
184+
"phpunit:integration": [
185+
"phpunit --colors=always --testsuite=integration"
186+
],
187+
"phpunit:functional": [
188+
"phpunit --colors=always --testsuite=functional"
171189
],
172190
"proxy-setup": [
173191
"symfony proxy:start",

0 commit comments

Comments
 (0)