Skip to content

Commit

Permalink
Merge branch 'master' of github.com:repman-io/repman into feat/php-8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xvilo committed Dec 18, 2023
2 parents c204b7d + 6819f07 commit 697b31c
Show file tree
Hide file tree
Showing 44 changed files with 458 additions and 18,713 deletions.
9 changes: 4 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
/tests
/var/*

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
/.php_cs.dist
###< friendsofphp/php-cs-fixer ###
###> php-cs-fixer/shim ###
/.php-cs-fixer.cache
/.php-cs-fixer.dist.php
###< php-cs-fixer/shim ###

###> phpunit/phpunit ###
/phpunit.xml
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ max_line_length = 160
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2
32 changes: 16 additions & 16 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
* text=auto

/ansible export-ignore
/bin/coverage-checker export-ignore
/docker export-ignore
/tests export-ignore
/.codecov.yml export-ignore
/.dockerignore export-ignore
/.env.docker export-ignore
/.env.test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/buddy.yml export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/ansible export-ignore
/bin/coverage-checker export-ignore
/docker export-ignore
/tests export-ignore
/.codecov.yml export-ignore
/.dockerignore export-ignore
/.env.docker export-ignore
/.env.test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/buddy.yml export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
23 changes: 23 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:

jobs:
job:
name: "Security"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
show-progress: false

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: '7.4.2'

- name: "Run composer audit"
run: "composer audit --no-dev --locked"
112 changes: 112 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: "Tests"

concurrency:
group: "tests-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

on:
pull_request:
push:
branches: [master]

jobs:
tests:
name: "PHP ${{ matrix.php }} | PostgreSQL ${{ matrix.postgresql }}"
runs-on: "ubuntu-latest"
container:
image: "php:${{ matrix.php-version }}-cli-alpine"
env:
DATABASE_URL: "postgresql://main:main@postgresql:5432/main?serverVersion=${{ matrix.postgresql }}&charset=utf8"
services:
postgresql:
image: "postgres:${{ matrix.postgresql-version }}-alpine"
env:
POSTGRES_USER: main
POSTGRES_PASSWORD: main
POSTGRES_DB: main

strategy:
fail-fast: false
matrix:
php:
- "7.4"
- "8.0"
postgresql:
- "11"
include:
- php: "7.4"
php-version: "7.4.2"
- php: "8.0"
php-version: "8.0.30"
- postgresql: "11"
postgresql-version: "11.7"

steps:
- name: "Install OS dependencies"
run: "apk add --no-cache bash git"

- name: "Adjust allowed PHP memory"
run: echo 'memory_limit = -1' > $PHP_INI_DIR/conf.d/memory-limit.ini;

- name: "Install PHP extensions"
shell: bash
run: |
wget https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions --quiet -O /usr/local/bin/install-php-extensions
chmod +x /usr/local/bin/install-php-extensions
install-php-extensions intl pdo_pgsql zip
- name: "Install composer"
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=2.6.6

- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ github.event.pull_request.head.ref || '' }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
show-progress: false

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"

- name: "Validate composer dependencies"
run: "composer validate"

- name: "Run composer audit"
run: "composer audit --no-dev --locked"

- name: "Check code style"
run: "composer check-cs"

- name: "Run PHPStan"
run: "composer phpstan"

- name: "Lint twig"
run: "bin/console lint:twig templates --show-deprecations"

- name: "Run migrations"
run: "bin/console doctrine:migrations:migrate --no-interaction"

- name: "Setup messenger transports"
run: "bin/console messenger:setup-transports"

- name: "Validate database schema"
run: "bin/console doctrine:schema:validate"

- name: "Set git committer info and configure git options"
shell: bash
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global --add safe.directory '*'
- name: "Run unit tests"
run: "composer phpunit:unit"

- name: "Run integration tests"
run: "composer phpunit:integration"

- name: "Run functional tests"
run: "composer phpunit:functional"

- name: "Warmup prod cache"
run: "bin/console cache:warmup --env=prod"
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
!/var/.gitkeep
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
Expand Down Expand Up @@ -43,3 +37,8 @@ docker-compose.*.yml

composer.phar
.php-cs-fixer.cache

###> php-cs-fixer/shim ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< php-cs-fixer/shim ###
5 changes: 3 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
$config = new PhpCsFixer\Config();
return $config->setRiskyAllowed(true)
->setRules([
'@PHP71Migration' => true,
'@PHP74Migration' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_between_import_groups' => false,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_unreachable_default_argument_value' => true,
Expand All @@ -19,7 +20,7 @@
'no_unused_imports' => true,
'declare_strict_types' => true,
'ordered_imports' => [
'imports_order' => null,
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'phpdoc_order' => true,
Expand Down
4 changes: 2 additions & 2 deletions buddy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/php"
docker_image_tag: "8.2.7"
docker_image_tag: "8.2.12"
execute_commands:
- "composer install"
- "composer validate"
Expand Down Expand Up @@ -83,7 +83,7 @@
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/php"
docker_image_tag: "8.2.7"
docker_image_tag: "8.2.12"
execute_commands:
- "/local-php-security-checker"
setup_commands:
Expand Down
23 changes: 19 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"friendsofphp/php-cs-fixer": "^3.11",
"johnkary/phpunit-speedtrap": "^4.0",
"league/flysystem-memory": "^1.0",
"php-cs-fixer/shim": "^3.9",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
Expand All @@ -111,6 +112,9 @@
"symfony/web-profiler-bundle": "5.4.*"
},
"config": {
"platform": {
"php": "7.4.2"
},
"preferred-install": {
"*": "dist"
},
Expand All @@ -120,8 +124,8 @@
"phpstan/extension-installer": true,
"symfony/flex": true
},
"platform": {
"php": "8.0.29"
"audit": {
"abandoned": "report"
}
},
"extra": {
Expand Down Expand Up @@ -168,10 +172,21 @@
],
"phpstan": [
"bin/console cache:clear --env=test",
"phpstan analyse --level=max"
"phpstan analyse --level=max --memory-limit=-1"
],
"phpunit": [
"phpunit --colors=always"
"@phpunit:unit",
"@phpunit:integration",
"@phpunit:functional"
],
"phpunit:unit": [
"phpunit --colors=always --testsuite=unit"
],
"phpunit:integration": [
"phpunit --colors=always --testsuite=integration"
],
"phpunit:functional": [
"phpunit --colors=always --testsuite=functional"
],
"proxy-setup": [
"symfony proxy:start",
Expand Down
Loading

0 comments on commit 697b31c

Please sign in to comment.