-
Notifications
You must be signed in to change notification settings - Fork 40
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
[TASK] Introduce GitHub actions powered workflow #147
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Going to work further on it tomorrow |
3rd party extension "georgringer/news" has been added as development dependency. That should prepare to test setups that extension provides. However, the dependency has been added in a version narrowing down the available core versions for development - without having any tests yet. Instead of dealing with a broad range of versions through out all core version, this dependency is removed again for now. After branching and dropping support for older TYPO3 core versions, this can be re-added along with adding the planed tests. Used command(s): ```shell composer remove --dev --no-update georgringer/news ```
sbuerk
force-pushed
the
github-actions-1
branch
26 times, most recently
from
February 26, 2023 00:12
81045f2
to
de11bdb
Compare
sbuerk
force-pushed
the
github-actions-1
branch
2 times, most recently
from
February 26, 2023 00:53
3177380
to
b0622a6
Compare
sbuerk
changed the title
[TASK] Introduce GitHub actions to guard code work
[TASK] Introduce GitHub actions powered workflow
Feb 26, 2023
This change makes some minor adjustment to the php-cs-fixer ruleset to taggle minor cgl rules. The main reason is, to get a first usable ruleset set and use php-cs-fixer as code cgl check in CI (GitHub Action). `php-cs-fixer` is used to apply the rule set as preparation to add this as GitHub action workflow check, to avoid code cgl violation in the future. Changed rules and/or options: * set rule `declare_equal_normalize` option `space`to `none` * add `blank_line_after_opening_tag` set to `true` Used command(s): ```shell php-cs-fixer fix --config .config/.php-cs-rules.php --ansi ```
This change moves tools configuration into directory structure under `Build/`, separating each tool to it's own subfolder. On the one hand, this is a preparation moving forward and aligning the CI tools and tests into known TYPO3 core structures. Additionally, it prepares for a later revert to the core testing-framework along with the core `runTests.sh` in parallel to the ddev logic.
`armin/editorconfig-cli` has been added as a test ballon to help with documentation rst files and other formats based on the `.editorconfig` rules. Rulesets cannot be taken hard, therefore running it as CI check and auto fixing it would more often breaks documentation and other files. Would always emit false-positives and is therefore useless. `.editorconfig` main reason to exist is to help in integrated development environments, to format code which matches a ruleset. For php code, where this is mainly needed, `php-cs-fixer` can do a better job at it. Only point is to avoid to much difference between them. Used command(s): ```shell composer remove --dev --no-update \ armin/editorconfig-cli ```
To avoid the need for a api and heavily abusing real api limits during automatic tests, especially for the upcoming github ci integration, a deepL mock api server is added as a additional ddev service with proper interconnection. Detection of ddev and environment variable configuration in the extension configuration setup for functional test is added. This covers the ddev setup automatically and also prepares for upcoming TYPO3 core `runTests.sh`. Therefore, functional tests can be executed against the mock server. Minor api url preparation has to be adopted due missing port support in the deepL service class: `\WebVision\WvDeepltranslate\Service\DeeplService` Mock server only supports specified text for translation, thus tests adjusted to reflect this.
The script ensuring prober composer requires and installation TYPO3 core version aware is moved from the .ddev folder to the more prominent `Build/Scripts/` folder. This raises the visibility for it and further prepares for the introduction of TYPO3 core `Build/Scripts/runTests.sh` testing.
New build folder is completly added to the `.gitattributes` file to ensure it is not exported in package archiving. Tests are not part of distribution packages.
Test related scripts and tests themself do not contain into exported archives and packages. Therefor, `Tests/` folder is added to `.gitattributes`.
This change introduces some GitHub action workflow definitions as a firsts round-up. Due several issues not all tests and php-versions are covered for now. The defined workflow kicks on on pushes, pull-requests and also adding scheduled runs (aka nightlies). No functional tests are executed yet, as this needs either a valid DeepL API key, and consuming limits and contigents. In a dedicated step, it can be tried to use the DeepL API MockServer for functional test. See: https://github.com/DeepLcom/deepl-mock **Note:** This is only a first start, after tackling the issues and streamlining and house-keeping has been done, this can be increased and further extended.
TYPO3 core uses and maintains several tools to check, guard and test the core. It's also a conveniant style to use the same technique for extension and project development. Developer with core contribution experience, at least they of them who contributes regularly, would find a same entry point around all testing related. Only requirement are: * docker deamon installed * docker-compose or docker compose plugin * bash to execute runTests.sh dispatcher Main thoughts and benefit of this techique is, that it has a low requirement profile and non-conflicting effect on all platforms. That makes this really conveniant to be used in any kind of CI like GitHub actions, GitLab CI workflows or locallay (MacOS, Linux, Windows/WSL2,..). Core contributors loves the fact, that the can simply look into a failed pipeline and simply copy'n paste the needed script commands without having to translate them to their local environments. By usind well-defined and versioned images, issues are reproducable on all systems eliminating environment depending differences and error sources. This change introduces the `Build/Scripts/runTests.sh` wrapping script as main dispatcher, along with the `Build/testing-docker/docker-compose.yml` file defining all available services which may be used by tools, tests and scripts. The service are defined in a non-conflicting way wo avoid interferiance with host system installations. The `ddev` based system to execute tools and tests is kept and not deprecated yet. Needed and usefull overlapping has been moved to central places, used by both systems. ddev has one minor flaw against `runTests.sh` it do not have multi dbms testing configured. Available `runTests.sh` scripts and further tests can be displayed with: ```shell Build/Scripts/runTests.sh -h ``` Further scripts are fetched from the TYPO3 core monorepo to increase code and documentation quality: * checkUtf8Bom.sh: Check for invalid UTF-8 BOM in files * validateRstFiles.php: Validate rst files integrity * checkTestMethodsPrefix: ensures tests methods do not start with "test" * checkExceptionCodes: Find duplicate exception codes Used command(s): ```shell composer req --dev --no-update \ "nikic/php-parser":"^4.15.1" ``` Last but not least, github action workflow is restructured and changed to use `Build/Scripts/runTests.sh` wrapper for all tasks.
sbuerk
force-pushed
the
github-actions-1
branch
from
February 26, 2023 01:10
b0622a6
to
03c0875
Compare
calien666
approved these changes
Feb 28, 2023
NarkNiro
approved these changes
Mar 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull-request integreates a enhanced CI guard
composed from several independat parts. The final
result contain following features:
For a list of possible
runTests.sh
commands see:Additional examples can be found in the GitHub actions
.github/worflows/testcore*.yml
files.Note Each commit contains a descriptive commit message.
Therefore, not copy&pasting them to here to avoid a lengthy
story book.
As a final word - this is a streamlining kick-off to get
automatic testing in charge. That increases acceptance for
contributors.
Resolves #102 - albit it's set to 4.x milestone, I would
suggest to integrate this directly and as soon as possible.