Skip to content

Commit

Permalink
TASK: Add gh:workflow to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mficzel committed Mar 19, 2024
1 parent a9b41a5 commit 5d5c359
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

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

jobs:
test:
name: "Test (PHP ${{ matrix.php-versions }}, Flow ${{ matrix.flow-versions }})"

strategy:
fail-fast: false
matrix:
php-versions: ["8.2"]
flow-versions: ["8.3"]
include:
- php-versions: '8.3'
flow-versions: '8.3'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ env.FLOW_FOLDER }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite
ini-values: date.timezone="Africa/Tunis", opcache.fast_shutdown=0, apc.enable_cli=on

- name: Set Neos Version
run: composer require neos/flow ^${{ matrix.flow-versions }} --no-progress --no-interaction

- name: Run Linter
run: composer lint

- name: Run Test
run: composer test
1 change: 1 addition & 0 deletions Classes/Controller/OpenApiController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Sitegeist\SchemeOnYou\Controller;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/OpenApiDocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function findDocumentByName(string $name): OpenApiDocument
// only include classes that match the $classNamePatterns
$includeClassName = false;
foreach ($documentClassNamePatterns as $documentClassNamePattern) {
if (fnmatch($documentClassNamePattern, $className, FNM_NOESCAPE)){
if (fnmatch($documentClassNamePattern, $className, FNM_NOESCAPE)) {
$includeClassName = true;
break;
}
Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
}
},
"scripts": {
"fix:code-style": [
"phpcbf --extensions=php --colors --standard=PSR12 ./Classes",
"phpcbf --extensions=php --colors --standard=PSR12 ./Tests"
],
"fix": [
"@fix:code-style"
],
"lint:code-style": [
"phpcs --extensions=php --colors --standard=PSR12 ./Classes",
"phpcs --extensions=php --colors --standard=PSR12 ./Tests"
Expand Down

0 comments on commit 5d5c359

Please sign in to comment.