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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ core.autocrlf=lf
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs export-ignore
.php-cs-fixer.dist.php export-ignore
.github export-ignore
phpunit.xml.dist export-ignore
/tests export-ignore
Expand Down
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "\U0001F41B Bug Report"
about: Report errors and problems
title: "[bug] "
labels: Potential Bug
assignees: ''

---

**Description**
<!-- A clear and concise description of the problem. -->

**How to reproduce**
<!-- Code and/or config needed to reproduce the problem. -->

**Possible Solution**
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

**Additional context**
<!-- Optional: any other context about the problem: log messages, screenshots, etc. -->
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/2_Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: "[Feature] "
labels: Feature
assignees: ''

---

**Description**
<!-- A clear and concise description of the new feature. -->

**Example**
<!-- A simple example of the new feature in action (include PHP code, YAML config, etc.)
If the new feature changes an existing feature, include a simple before/after comparison. -->
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: 👩‍🏫 Support Question
about: Questions about using this library
labels: Question / Support

---

**Description**
<!-- A clear and concise description of the problem. Also include what you tried, and any code
snippets if you have them.

Please be patient, it may take some to get a response. Thanks.
-->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/4_Security_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: ⛔ Security Issue
about: Report security issues and problems (PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY)

---

⚠ PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, SEE BELOW.

If you have found a security issue in this project, please send the details to
security [at] rollerscapes.net and don't disclose it publicly until we can provide a
fix for it.

**Note:** Please don't blindly send reports about automated tools, make sure the
reported issue is in fact exploitable. Thanks.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
| Q | A
| ------------- | ---
| Bug fix? | yes/no
| New feature? | yes/no
| BC breaks? | yes/no
| Deprecations? | yes/no
| Fixed tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT

<!--
- Please fill in this template according to the PR you're about to submit.
Provide additional information in your description, not the questioner table.
- Replace this comment by a description of what your PR is solving.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
-->
13 changes: 13 additions & 0 deletions .github/composer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"config": {
"cache-vcs-dir": "/dev/null",
"platform-check": false,
"preferred-install": {
"*": "dist"
},
"allow-plugins": {
"ergebnis/composer-normalize": true,
"symfony/flex": true
}
}
}
68 changes: 0 additions & 68 deletions .github/workflows/ci.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/composer-validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Composer Validate

on:
push:
paths:
- 'composer.json'
pull_request:
paths:
- 'composer.json'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
composer-sync:
name: 'Composer validation'
runs-on: ubuntu-24.04
env:
php-version: '8.4'

steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
ini-values: "memory_limit=-1"
coverage: none

-
name: Checkout target branch
uses: actions/checkout@v6

-
name: 'Install dependencies'
run: |
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
composer global require -q "ergebnis/composer-normalize"
composer install --no-progress

-
name: 'Normalized composer.json'
run: |
echo "composer.json"
composer validate
composer normalize
16 changes: 16 additions & 0 deletions .github/workflows/inspector-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CS

on:
pull_request:

permissions:
contents: read

jobs:
call-inspector-bot:
name: InspectorBot
uses: rollerscapes/inspector-bot/.github/workflows/inspector-bot.yml@main
with:
package: RollerworksVersion
check_license: true

62 changes: 62 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PHPStan

on:
pull_request:

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-24.04

env:
php-version: '8.2'
steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
ini-values: "memory_limit=-1"
coverage: none

-
name: Checkout target branch
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}

-
name: Checkout PR
uses: actions/checkout@v6

-
name: Install dependencies
run: |
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
composer install --no-progress --ansi --no-plugins

-
name: Generate PHPStan baseline
run: |
git checkout composer.json
git checkout -m ${{ github.base_ref }}
vendor/bin/phpstan analyze --generate-baseline --allow-empty-baseline --no-progress
git checkout -m FETCH_HEAD

-
name: PHPStan
run: |
vendor/bin/phpstan analyze --no-progress --error-format=github

50 changes: 50 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

test:

name: 'PHPUnit with PHP ${{ matrix.php-version }}'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- php-version: '8.1'
- php-version: '8.2'
- php-version: '8.3'
- php-version: '8.4'
- php-version: '8.5'
steps:
-
name: Checkout
uses: actions/checkout@v6

-
name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: none
env:
update: true

-
name: 'Install dependencies'
env:
COMPOSER_OPTIONS: '${{ matrix.composer-options }}'
SYMFONY_REQUIRE: '${{ matrix.symfony-version }}'
run: |
composer update --no-progress --no-interaction --optimize-autoloader $COMPOSER_OPTIONS

-
name: Run Tests
run: make phpunit
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
/composer.lock
*.phar
/vendor/
/.php_cs.cache
.phpunit.result.cache
.php-cs-fixer.cache
34 changes: 34 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

$header = <<<EOF
This file is part of the Rollerworks Semver package.

(c) Sebastiaan Stok <s.stok@rollerscapes.net>

This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;

/** @var \Symfony\Component\Finder\Finder $finder */
$finder = PhpCsFixer\Finder::create();
$finder
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules(
array_merge(
require __DIR__ . '/vendor/rollerscapes/standards/php-cs-fixer-rules.php',
[
'header_comment' => ['header' => $header],
'mb_str_functions' => false,
'php_unit_test_annotation' => ['style' => 'annotation'], // For now
])
)
->setFinder($finder);

return $config;
Loading
Loading