Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI #1

Merged
merged 2 commits into from
May 16, 2024
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
99 changes: 99 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

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

jobs:
code_quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: symfony-cli

- name: Install Composer dependencies
run: symfony composer install --prefer-dist --no-interaction --no-progress

- name: Run Easy Coding Standard
run: symfony php vendor/bin/ecs

test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
# Minimum supported dependencies with the latest and oldest PHP version
- PHP_VERSION: '8.1'
COMPOSER_FLAGS: --prefer-stable --prefer-lowest
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.1'
COMPOSER_FLAGS: --prefer-stable --prefer-lowest
SYMFONY_VERSION: '7.0'

# Latest 6.4 stable releases
- PHP_VERSION: '8.1'
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '6.4'

# Latest 7.0 stable releases
- PHP_VERSION: '8.1'
SYMFONY_VERSION: '7.0'
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.0'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '7.0'

# Latest 7.x development releases
- PHP_VERSION: '8.1'
SYMFONY_VERSION: '7.*'
STABILITY: dev
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.*'
STABILITY: dev
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.*'
STABILITY: dev
env:
SYMFONY_REQUIRE: ${{ matrix.config.SYMFONY_VERSION }}
steps:
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.config.PHP_VERSION }}
tools: symfony-cli

- name: Install globally Symfony Flex
run: |
symfony composer global require --no-progress --no-scripts --no-plugins symfony/flex
symfony composer global config --no-plugins allow-plugins.symfony/flex true

- name: Configure Composer minimum stability
if: matrix.config.STABILITY
run: symfony composer config minimum-stability ${{ matrix.config.STABILITY }}

- name: Install Composer dependencies
run: symfony composer update ${{ matrix.config.COMPOSER_FLAGS }} --prefer-dist --no-interaction --no-progress

- name: Run PHPStan
run: symfony php vendor/bin/phpstan analyze

- name: Run PHPUnit
run: symfony php vendor/bin/phpunit
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"require-dev": {
"phpstan/phpstan": "^1.11",
"symplify/easy-coding-standard": "^12.1",
"phpunit/phpunit": "^11.1"
"phpunit/phpunit": "^10.5 || ^11.1"
}
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" backupGlobals="false" colors="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="false" colors="true"
bootstrap="vendor/autoload.php">
<php>
<ini name="display_errors" value="1"/>
Expand Down
Empty file added src/.gitkeep
Empty file.