Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
{
"name": "codeception-github-reporter",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "php",
"shutdownAction": "none",
"workspaceFolder": "/var/www/",
"extensions": [
"bmewburn.vscode-intelephense-client",
"hbenl.vscode-test-explorer",
"recca0120.vscode-phpunit",
"eamodio.gitlens",
"mhutchie.git-graph",
"junstyle.php-cs-fixer"
]
"customizations": {
"vscode": {
"extensions": [
"bmewburn.vscode-intelephense-client",
"hbenl.vscode-test-explorer",
"recca0120.vscode-phpunit",
"eamodio.gitlens",
"mhutchie.git-graph",
"junstyle.php-cs-fixer",
"janbn.git-last-commit-message",
"kasik96.latte",
"seatonjiang.gitmoji-vscode"
]
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2.5.7": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"upgradePackages": true
}
}
}
18 changes: 9 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PHP_VERSION=56|73|74|80
GITHUB_OWNER: Owner of repository
GITHUB_REPO: Name of repository
GITHUB_PR_NUMBER: Number of pull request of repository
GITHUB_TOKEN: Token of the user's github who will post the comment
TEST_LANG: Language
TEST_TITLE: Message to show in title
TEST_FOOTER: Show footer with version of PHP
IMGBB_TOKEN: Token to upload image acceptance test
PHP_VERSION=74|80|81|82|83
GITHUB_OWNER=Owner of repository
GITHUB_REPO=Name of repository
GITHUB_PR_NUMBER=Number of pull request of repository
GITHUB_TOKEN=Token of the user's github who will post the comment
TEST_LANG=Language
TEST_TITLE=Message to show in title
TEST_FOOTER=Show footer with version of PHP
IMGBB_TOKEN=Token to upload image acceptance test
36 changes: 0 additions & 36 deletions .github/workflows/ci-56.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/ci-73.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/ci-74.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/ci-80.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
push:
branches:
- master

pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

test:
strategy:
matrix:
PHP: [74, 80, 81, 82, 83]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Prepare code
env:
PHP_VERSION: ${{ matrix.PHP }}
run: |
touch .env
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
echo "PHP_VERSION=$PHP_VERSION" >> .env

- name: Up environment
run: |
docker compose up -d

- name: Wait environment
run: |
echo $(docker compose -f docker-compose.wait.yml run --rm wait)

- name: Environment logs
run: |
docker compose ps
docker compose logs php

- name: Run Lint
run: |
docker compose exec -T php composer lint

- name: Run PHP Unit
continue-on-error: true
run: |
docker compose exec -T php composer test

- name: Run PHP Stan
run: |
docker compose exec -T php composer analyse

- name: Run PHP CS Fixer
run: |
docker compose exec -T php composer fix:ci

- name: Desligando ambiente
if: ${{ always() }}
run: |
docker compose exec -T php rm -Rf vendor/ .env
docker compose down --remove-orphans
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.history/
.env
composer.lock
.php-cs-fixer.cache
53 changes: 53 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

$rules = [
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'multiline_whitespace_before_semicolons' => false,
'echo_tag_syntax' => false,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'no_useless_else' => true,
'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']],
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_indent' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_to_comment' => true,
'single_quote' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'curly_braces_position' => [
'classes_opening_brace' => 'same_line',
'functions_opening_brace' => 'same_line',
],
'visibility_required' => ['elements' => ['property', 'method']],
];

$excludes = [
'vendor',
'.vscode',
'.github',
'.devcontainer',
'tests/_support/_generated/',
];

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude($excludes)
->notName('README.md')
->notName('*.xml')
->notName('*.yml')
->notName('_ide_helper.php')
;

return (new PhpCsFixer\Config())
->setRules($rules)
->setFinder($finder)
->setIndent("\t")
;
43 changes: 0 additions & 43 deletions .php_cs

This file was deleted.

Loading