Skip to content

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
loicsapone committed Mar 1, 2024
1 parent 444b2ad commit 65da1dd
Showing 1 changed file with 119 additions and 0 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: "Continuous Integration"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check-dependencies:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
tools: composer-require-checker, composer-unused

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Composer Require Checker
run: composer-require-checker

- name: Composer Unused
run: composer-unused --excludePackage=symfony/dependency-injection --excludePackage=symfony/property-access

php-cs-fixer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: PHP-CS-Fixer
run: php vendor/bin/php-cs-fixer fix --dry-run --diff --no-ansi

phpstan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: PHPStan
run: php vendor/bin/phpstan analyse

rector:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: RectorPHP
run: php vendor/bin/rector process --dry-run

phpunit:
strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-version: [ '8.1', '8.2', '8.3' ]

runs-on: ${{ matrix.operating-system }}

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Test PHPUnit
run: php vendor/bin/phpunit

0 comments on commit 65da1dd

Please sign in to comment.