Skip to content

Commit 38eddff

Browse files
authored
IBX-10763: Added configuration templates and setup command (#1)
1 parent 5ea10ed commit 38eddff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+20181
-129
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,58 @@
11
name: CI
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- '[0-9]+.[0-9]+'
8-
pull_request: ~
4+
push:
5+
branches:
6+
- main
7+
- '[0-9]+.[0-9]+'
8+
pull_request: ~
99

1010
jobs:
11-
cs-fix:
12-
if: github.event.repository.name != 'bundle-template-internal'
13-
name: Run code style check
14-
runs-on: "ubuntu-22.04"
15-
strategy:
16-
matrix:
17-
php:
18-
- '8.0'
19-
steps:
20-
- uses: actions/checkout@v3
21-
22-
- name: Setup PHP Action
23-
uses: shivammathur/setup-php@v2
24-
with:
25-
php-version: ${{ matrix.php }}
26-
coverage: none
27-
extensions: 'pdo_sqlite, gd'
28-
tools: cs2pr
29-
30-
# Only for packages that are private - uncomment if needed
31-
# - name: Add composer keys for private packagist
32-
# run: |
33-
# composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
34-
# composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN
35-
# env:
36-
# SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
37-
# SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
38-
# TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}
39-
40-
- uses: ramsey/composer-install@v2
41-
with:
42-
dependency-versions: "highest"
43-
44-
- name: Run code style check
45-
run: composer run-script check-cs -- --format=checkstyle | cs2pr
46-
47-
tests:
48-
if: github.event.repository.name != 'bundle-template-internal'
49-
name: Tests
50-
runs-on: "ubuntu-22.04"
51-
timeout-minutes: 10
52-
53-
strategy:
54-
fail-fast: false
55-
matrix:
56-
php:
57-
- '7.4'
58-
- '8.0'
59-
- '8.1'
60-
- '8.2'
61-
62-
steps:
63-
- uses: actions/checkout@v3
64-
65-
- name: Setup PHP Action
66-
uses: shivammathur/setup-php@v2
67-
with:
68-
php-version: ${{ matrix.php }}
69-
coverage: none
70-
extensions: pdo_sqlite, gd
71-
tools: cs2pr
72-
73-
# Only for packages that are private - uncomment if needed
74-
# - name: Add composer keys for private packagist
75-
# run: |
76-
# composer config http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
77-
# composer config github-oauth.github.com $TRAVIS_GITHUB_TOKEN
78-
# env:
79-
# SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
80-
# SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
81-
# TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }}
82-
83-
- uses: ramsey/composer-install@v2
84-
with:
85-
dependency-versions: "highest"
86-
composer-options: "${{ matrix.composer_options }}"
87-
88-
- name: Setup problem matchers for PHPUnit
89-
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
90-
91-
- name: Run PHPStan analysis
92-
run: composer run-script phpstan
93-
94-
- name: Run test suite
95-
run: composer run-script --timeout=600 test
11+
cs-fix:
12+
name: Run code style check
13+
runs-on: "ubuntu-24.04"
14+
strategy:
15+
matrix:
16+
php:
17+
- '8.3'
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- uses: ibexa/gh-workflows/actions/composer-install@main
22+
with:
23+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
24+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
25+
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
26+
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}
27+
28+
- name: Run code style check
29+
run: composer run-script check-cs -- --format=checkstyle | cs2pr
30+
31+
tests:
32+
name: Tests
33+
runs-on: "ubuntu-24.04"
34+
timeout-minutes: 10
35+
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
php:
40+
- '8.3'
41+
steps:
42+
- uses: actions/checkout@v5
43+
44+
- uses: ibexa/gh-workflows/actions/composer-install@main
45+
with:
46+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
47+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
48+
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
49+
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}
50+
51+
- name: Setup problem matchers for PHPUnit
52+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
53+
54+
- name: Run PHPStan analysis
55+
run: composer run-script phpstan
56+
57+
- name: Run test suite
58+
run: composer run-script --timeout=600 test

.github/workflows/frontend-ci.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/rector.yaml.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Rector PHP
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- '[0-9]+.[0-9]+'
7+
pull_request: ~
8+
jobs:
9+
rector:
10+
name: Run rector
11+
uses: ibexa/gh-workflows/.github/workflows/rector.yml@main
12+
secrets:
13+
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
14+
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
15+
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
16+
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
17+
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}

.github/workflows/release.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Call Automatic Changelog Generator for tag Workflow
22

3-
on:
4-
push:
5-
tags:
6-
- 'v*'
7-
- '!v*-alpha*'
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
- '!v*-alpha*'
88

99
jobs:
10-
create_release_for_tag:
11-
uses: ibexa/gh-workflows/.github/workflows/release_bundle.yml@main
12-
secrets:
13-
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
10+
create_release_for_tag:
11+
uses: ibexa/gh-workflows/.github/workflows/release_bundle.yml@main
12+
secrets:
13+
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: On PR Review Requested
2+
3+
on:
4+
pull_request:
5+
types: [review_requested]
6+
7+
jobs:
8+
call-expand-team-reviewers:
9+
if: ${{ github.event.requested_team }}
10+
uses: ibexa/gh-workflows/.github/workflows/expand-team-reviewers.yml@main
11+
with:
12+
requested_team: ${{ github.event.requested_team.slug }}
13+
pull_request_number: ${{ github.event.pull_request.number }}
14+
repository: ${{ github.repository }}
15+
secrets: inherit

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/vendor
2+
/phpunit.xml
3+
/.php_cs.cache
4+
composer.lock
5+
.php-cs-fixer.cache
6+
.phpunit.result.cache

.php-cs-fixer.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;
10+
11+
$configFactory = new InternalConfigFactory();
12+
$configFactory->withRules([
13+
'declare_strict_types' => false
14+
]);
15+
16+
return $configFactory
17+
->buildConfig()
18+
->setFinder(
19+
PhpCsFixer\Finder::create()
20+
->in([
21+
__DIR__ . '/src',
22+
__DIR__ . '/tests',
23+
])
24+
->files()->name('*.php')
25+
);

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"prefer-stable": true,
1616
"require": {
1717
"php": ">=8.3",
18+
"composer/semver": "^3.4",
1819
"ibexa/core": "~5.0.x-dev",
1920
"symfony/config": "^7.3",
2021
"symfony/dependency-injection": "^7.3",
@@ -56,15 +57,13 @@
5657
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php --show-progress=dots",
5758
"check-cs": "@fix-cs --dry-run",
5859
"test": "phpunit -c phpunit.xml.dist",
59-
"test-integration": "phpunit -c phpunit.integration.xml",
6060
"phpstan": "phpstan analyse -c phpstan.neon",
6161
"deptrac": "php vendor/bin/deptrac analyse"
6262
},
6363
"scripts-descriptions": {
6464
"fix-cs": "Automatically fixes code style in all files",
6565
"check-cs": "Run code style checker for all files",
6666
"test": "Run automatic tests",
67-
"test-integration": "Run integration tests",
6867
"phpstan": "Run static code analysis",
6968
"deptrac": "Run Deptrac architecture testing"
7069
},

0 commit comments

Comments
 (0)