Skip to content

Commit

Permalink
Merge branch 'master' into fix/catch-any-throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
ssgoncalves committed Jan 3, 2023
2 parents 72aac6a + 7825230 commit 4f39562
Show file tree
Hide file tree
Showing 150 changed files with 2,300 additions and 1,385 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
86 changes: 86 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Continuous Integration

on:
- push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
testing:
name: Testing and Code Quality for PHP
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
env:
KAFKA_BROKER_CONNECTIONS: 'localhost:9092'
services:
zookeeper:
image: bitnami/zookeeper
env:
ALLOW_ANONYMOUS_LOGIN: yes
kafka:
image: bitnami/kafka
ports:
- '9092:9092'
env:
KAFKA_LISTENERS: 'PLAINTEXT://:9092'
KAFKA_CFG_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092'
KAFKA_CFG_ZOOKEEPER_CONNECT: 'zookeeper:2181'
ALLOW_PLAINTEXT_LISTENER: yes
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP cache environment
id: php-ext-cache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: rdkafka-arnaud-lb/php-rdkafka@6.0.3
key: metamorphosis-php-extensions-${{ matrix.php }}

- name: Cache PHP extensions
uses: actions/cache@v3
with:
path: ${{ steps.php-ext-cache.outputs.dir }}
key: ${{ steps.php-ext-cache.outputs.key }}
restore-keys: ${{ steps.php-ext-cache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
RDKAFKA_LIBS: librdkafka-dev
with:
php-version: ${{ matrix.php }}
extensions: rdkafka-arnaud-lb/php-rdkafka@6.0.3
tools: cs2pr

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: metamorphosis-vendor-${{ hashFiles('composer.lock') }}

- name: Composer
uses: ramsey/composer-install@v2

- name: Run code standards
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr

- name: Run psalm
run: vendor/bin/psalm --php-version=${{ matrix.php }} --output-format=github

- name: Run tests
run: vendor/bin/phpunit

- name: Report Coverage
continue-on-error: true
run: CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} bash <(curl -Ls https://coverage.codacy.com/get.sh) report
22 changes: 0 additions & 22 deletions .github/workflows/push.yml

This file was deleted.

29 changes: 18 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@
],
"description": "Kafka package for laravel applications",
"require": {
"ext-rdkafka": "*",
"ext-rdkafka": ">=4.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.5.0 || ^7.0",
"illuminate/support": "^5.5 || ^6.0 || ^7.0 || ^8.0",
"illuminate/console": "^5.5 || ^6.0 || ^7.0 || ^8.0",
"illuminate/config": "^5.5 || ^6.0 || ^7.0 || ^8.0",
"php": ">=7.1",
"wikimedia/avro": "^1.7"
"php": ">=7.4",
"wikimedia/avro": "^1.9.0"
},
"require-dev": {
"leroy-merlin-br/coding-standard": "^1.0.1",
"phpunit/phpunit": "^9.4.3",
"mockery/mockery": "^1.3.0",
"kwn/php-rdkafka-stubs": "~1.1.0",
"orchestra/testbench": "^6.0",
"leroy-merlin-br/coding-standard": "^v3.1.0",
"phpunit/phpunit": "^9.5.27",
"mockery/mockery": "^1.5.1",
"kwn/php-rdkafka-stubs": "^2.2.1",
"orchestra/testbench": "^6.25.1",
"dms/phpunit-arraysubset-asserts": "^0.2.1",
"phpro/grumphp": "^1.5",
"vimeo/psalm": "^4.18",
"psalm/plugin-mockery": "^0.9.1"
"phpro/grumphp": "^1.13.0",
"vimeo/psalm": "^4.30.0",
"psalm/plugin-mockery": "^0.9.1",
"rector/rector": "^0.13.10"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -58,5 +59,11 @@
"@composer install",
"vendor/bin/grumphp git:init"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpro/grumphp": true
}
}
}
Loading

0 comments on commit 4f39562

Please sign in to comment.