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

👷 WIP CI #49

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 10 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
122 changes: 122 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

# Configuration for running GitHub actions
# based on https://github.com/sypets/brofix/blob/main/.github/workflows/ci.yml

name: CI

on:
push:
pull_request:

jobs:
all_core_9:
name: "all core-9"
runs-on: ubuntu-20.04
strategy:
# This prevents cancellation of matrix job runs, if one/two already failed and let the
# rest matrix jobs be be executed anyway.
fail-fast: false
matrix:
php: [ '7.2', '7.3', '7.4' ]
minMax: [ 'composerInstallMin', 'composerInstallMax' ]
steps:
- name: "Checkout"
uses: actions/checkout@v3

# This must be checked before core version select is run, as this would write this
# and than the check would fail - obiously.
- name: "Check if typo3/minimal has been pushed in composer.json"
run: Build/Scripts/checkComposerJsonForPushedMinimalPackage.sh

- name: "Set Typo3 core version"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t "^9.5" -s composerCoreVersion

- name: "Composer"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s ${{ matrix.minMax }}

- name: "cgl"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s cgl -v -n

- name: "Composer validate"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate

- name: "Lint PHP"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint

- name: "phpstan"
if: ${{ always() && matrix.minMax == 'composerInstallMax' }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s phpstan

- name: "Unit tests"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit

- name: "Functional tests with mariadb"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -s functional

- name: "Functional tests with sqlite (nightly or pull_request)"
if: ${{ always() && (github.event_name == 'schedule' || github.event_name == 'pull_request' ) }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d sqlite -s functional

- name: "Functional tests with postgres (nightly or pull_request)"
if: ${{ always() && (github.event_name == 'schedule' || github.event_name == 'pull_request' ) }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional

all_core_10:
name: "all core-10"
runs-on: ubuntu-20.04
strategy:
# This prevents cancellation of matrix job runs, if one/two already failed and let the
# rest matrix jobs be be executed anyway.
fail-fast: false
matrix:
php: [ '7.2', '7.3', '7.4' ]
minMax: [ 'composerInstallMin', 'composerInstallMax' ]
steps:
- name: "Checkout"
uses: actions/checkout@v3

# This must be checked before core version select is run, as this would write this
# and than the check would fail - obiously.
- name: "Check if typo3/minimal has been pushed in composer.json"
run: Build/Scripts/checkComposerJsonForPushedMinimalPackage.sh

- name: "Set Typo3 core version"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t "^10.4" -s composerCoreVersion

- name: "Composer"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s ${{ matrix.minMax }}

- name: "cgl"
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s cgl -v -n

- name: "Composer validate"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate

- name: "Lint PHP"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint

- name: "phpstan"
if: ${{ always() && matrix.minMax == 'composerInstallMax' }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s phpstan

- name: "Unit tests"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit

- name: "Functional tests with mariadb"
if: always()
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -s functional

- name: "Functional tests with sqlite (nightly or pull_request)"
if: ${{ always() && (github.event_name == 'schedule' || github.event_name == 'pull_request' ) }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d sqlite -s functional

- name: "Functional tests with postgres (nightly or pull_request)"
if: ${{ always() && (github.event_name == 'schedule' || github.event_name == 'pull_request' ) }}
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional
29 changes: 29 additions & 0 deletions .github/workflows/ter-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: TYPO3 Extension TER Release
on:
push:
tags:
- '*'
jobs:
ter-release:
name: TYPO3 TER Release
runs-on: ubuntu-latest
env:
TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }}
TYPO3_REPOSITORY_URL: ${{ secrets.TYPO3_REPOSITORY_URL }}
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }}
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}

steps:
- name: Grab new version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: intl, mbstring, xml, soap, zip, curl
- name: Install TYPO3 Tailor Extension
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest
- name: Release EXT:${{ env.TYPO3_EXTENSION_KEY }} as ${{ steps.get_version.outputs.VERSION }} to TER
run: php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=${{ env.TYPO3_REPOSITORY_URL }}/archive/${{ steps.get_version.outputs.VERSION }}.zip --comment="Successfully release new version ${{ steps.get_version.outputs.VERSION }} - see changelog at ${{ env.TYPO3_REPOSITORY_URL }}"
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
/.idea/
/.Build/
/.idea/
/.php_cs.cache
/.php-cs-fixer.cache
/Build/testing-docker/.env
/Build/yarn/node_modules
/composer.lock
/Documentation-GENERATED-temp
/node_modules
/Tests/Unit/.phpunit.result.cache
/var/
105 changes: 105 additions & 0 deletions Build/.php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ .Build/bin/php-cs-fixer fix -v --config ./Build/.php-cs-fixer.php Classes Tests
*
* For more information read:
* https://www.php-fig.org/psr/psr-2/
* https://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
// Define in which folders to search and which folders to exclude
// Exclude some directories that are excluded by Git anyways to speed up the sniffing
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('typo3conf')
->exclude('typo3temp')
->exclude('typo3/sysext/core/Tests/Acceptance/Support/_generated')
->notName('install.php')
->notName('index.php')
->in(__DIR__ . '/../');
// Return a Code Sniffing configuration using
// all sniffers needed for PSR-2
// and additionally:
// - Remove leading slashes in use clauses.
// - PHP single-line arrays should not have trailing comma.
// - Single-line whitespace before closing semicolon are prohibited.
// - Remove unused use statements in the PHP source code
// - Ensure Concatenation to have at least one whitespace around
// - Remove trailing whitespace at the end of blank lines.
$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'braces' => ['allow_single_line_closure' => true],
'cast_spaces' => ['space' => 'none'],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'dir_constant' => true,
'function_typehint_space' => true,
'single_line_comment_style' => true,
'lowercase_cast' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'modernize_types_casting' => true,
'native_function_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
'php_unit_mock_short_will_return' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_no_access' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'return_type_declaration' => ['space_before' => 'none'],
'single_quote' => true,
'single_trait_insert_per_statement' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder($finder);
return $config;
Loading