Skip to content

Commit

Permalink
Configure continuous integration with GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Ben87 committed Feb 11, 2023
1 parent 3462a9e commit 2db2a65
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Quality'

on:
push:
branches: ['*']

jobs:
phpcs:
name: 'PHP CodeSniffer'
runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version: ['8.1']

steps:
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

- name: 'Checkout sources'
uses: 'actions/checkout@v3'

- name: 'Install dependencies'
run: 'composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist'

- name: 'Execute PHP CodeSniffer'
run: 'vendor/bin/phpcs -p'

phpstan:
name: 'PHPStan'
runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version: ['8.1']

steps:
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

- name: 'Checkout sources'
uses: 'actions/checkout@v3'

- name: 'Install dependencies'
run: 'composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist'

- name: 'Execute PHPStan'
run: 'vendor/bin/phpstan'
62 changes: 62 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Tests'

on:
push:
branches: ['1.x']

jobs:
unit:
name: 'Unit tests'
runs-on: 'ubuntu-latest'
env:
SYMFONY_REQUIRE: '${{matrix.symfony-require}}'

strategy:
matrix:
php-version: ['8.1']
symfony-require: ['5.0.*', '5.1.*', '5.2.*', '5.3.*', '5.4.*', '6.0.*', '6.1.*', '6.2.*']

steps:
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

- name: 'Checkout sources'
uses: 'actions/checkout@v3'

- name: 'Install dependencies'
run: 'composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist'

- name: 'Execute Unit tests'
run: 'vendor/bin/phpunit'

coverage:
name: 'Code coverage'
runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version: ['8.1']

steps:
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'pcov'

- name: 'Checkout sources'
uses: 'actions/checkout@v3'

- name: 'Install dependencies'
run: 'composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist'

- name: 'Execute Unit tests'
run: 'vendor/bin/phpunit --coverage-clover=coverage.xml'

- name: 'Upload coverage file'
uses: 'codecov/codecov-action@v3'
with:
files: 'coverage.xml'
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PrestaDatadogBundle

![tests](https://github.com/prestaconcept/PrestaDatadogBundle/actions/workflows/tests.yml/badge.svg)
![quality](https://github.com/prestaconcept/PrestaDatadogBundle/actions/workflows/quality.yml/badge.svg)
[![codecov](https://codecov.io/gh/prestaconcept/PrestaDatadogBundle/branch/1.x/graph/badge.svg?token=S8SVUCZYRI)](https://codecov.io/gh/prestaconcept/PrestaDatadogBundle)

The PrestaDatadogBundle provides a [Monolog][1] handler for [Datadog Log Management][2] platform.

It exposes a friendly configuration to help you make your Symfony application communicate with your Datadog instance painlessly.
Expand Down

0 comments on commit 2db2a65

Please # to comment.