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
143 changes: 53 additions & 90 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,95 +1,58 @@
name: CI

on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request: ~
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request: ~

jobs:
cs-fix:
if: github.event.repository.name != 'bundle-template-internal'
name: Run code style check
runs-on: "ubuntu-22.04"
strategy:
matrix:
php:
- '8.0'
steps:
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

# Only for packages that are private - uncomment if needed
# - name: Add composer keys for private packagist
# run: |
# composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
# composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN
# env:
# SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
# SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
# TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}

- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
if: github.event.repository.name != 'bundle-template-internal'
name: Tests
runs-on: "ubuntu-22.04"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

steps:
- uses: actions/checkout@v3

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr

# Only for packages that are private - uncomment if needed
# - name: Add composer keys for private packagist
# run: |
# composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
# composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN
# env:
# SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
# SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
# TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}

- uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
composer-options: "${{ matrix.composer_options }}"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run PHPStan analysis
run: composer run-script phpstan

- name: Run test suite
run: composer run-script --timeout=600 test
cs-fix:
name: Run code style check
runs-on: "ubuntu-24.04"
strategy:
matrix:
php:
- '8.3'
steps:
- uses: actions/checkout@v5

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Tests
runs-on: "ubuntu-24.04"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
php:
- '8.3'
steps:
- uses: actions/checkout@v5

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run PHPStan analysis
run: composer run-script phpstan

- name: Run test suite
run: composer run-script --timeout=600 test
28 changes: 0 additions & 28 deletions .github/workflows/frontend-ci.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/rector.yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Rector PHP
on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request: ~
jobs:
rector:
name: Run rector
uses: ibexa/gh-workflows/.github/workflows/rector.yml@main
secrets:
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
18 changes: 9 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Call Automatic Changelog Generator for tag Workflow

on:
push:
tags:
- 'v*'
- '!v*-alpha*'
on:
push:
tags:
- 'v*'
- '!v*-alpha*'

jobs:
create_release_for_tag:
uses: ibexa/gh-workflows/.github/workflows/release_bundle.yml@main
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
create_release_for_tag:
uses: ibexa/gh-workflows/.github/workflows/release_bundle.yml@main
secrets:
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/reviewers.yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: On PR Review Requested

on:
pull_request:
types: [review_requested]

jobs:
call-expand-team-reviewers:
if: ${{ github.event.requested_team }}
uses: ibexa/gh-workflows/.github/workflows/expand-team-reviewers.yml@main
with:
requested_team: ${{ github.event.requested_team.slug }}
pull_request_number: ${{ github.event.pull_request.number }}
repository: ${{ github.repository }}
secrets: inherit
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/vendor
/phpunit.xml
/.php_cs.cache
composer.lock
.php-cs-fixer.cache
.phpunit.result.cache
25 changes: 25 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.3",
"composer/semver": "^3.4",
"ibexa/core": "~5.0.x-dev",
"symfony/config": "^7.3",
"symfony/dependency-injection": "^7.3",
Expand Down Expand Up @@ -56,15 +57,13 @@
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit -c phpunit.xml.dist",
"test-integration": "phpunit -c phpunit.integration.xml",
"phpstan": "phpstan analyse -c phpstan.neon",
"deptrac": "php vendor/bin/deptrac analyse"
},
"scripts-descriptions": {
"fix-cs": "Automatically fixes code style in all files",
"check-cs": "Run code style checker for all files",
"test": "Run automatic tests",
"test-integration": "Run integration tests",
"phpstan": "Run static code analysis",
"deptrac": "Run Deptrac architecture testing"
},
Expand Down
Loading
Loading