Skip to content

Commit

Permalink
[FEATURE] add basic static QA from EXT:tea as github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmschuler committed May 3, 2022
1 parent 96a823f commit bfe3cba
Show file tree
Hide file tree
Showing 48 changed files with 74,203 additions and 55 deletions.
53 changes: 53 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# JS files
[*.js]
indent_size = 2

# JSON files
[*.json]
indent_style = tab

# package.json
[package.json]
indent_size = 2

# ReST files
[{*.rst,*.rst.txt}]
indent_size = 3
max_line_length = 80

# SQL files
[*.sql]
indent_style = tab
indent_size = 2

# TypoScript files
[*.{typoscript,tsconfig}]
indent_size = 2

# YAML files
[{*.yml,*.yaml}]
indent_size = 2

# XLF files
[*.xlf]
indent_style = tab

# .htaccess
[.htaccess]
indent_style = tab

# Markdown files
[*.md]
max_line_length = 80
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"env": {
"browser": true
}
}
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/.Build/ export-ignore
/.ddev/ export-ignore
/.editorconfig export-ignore
/.eslintignore export-ignore
/.eslintrc.json export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitlab/ export-ignore
/.php-cs-fixer.php export-ignore
/.phpstorm.meta.php export-ignore
/.prettierrc.js export-ignore
/Tests/ export-ignore
/codeception.yml export-ignore
/phive.xml export-ignore
/phpcs.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/tools/ export-ignore binary
263 changes: 263 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
---
# This GitHub Actions workflow uses the same development tools that are also installed locally
# via Composer or PHIVE and calls them using the Composer scripts.
name: CI with Composer scripts
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '15 3 * * 1'
jobs:
php-lint:
name: "PHP linter"
runs-on: ubuntu-20.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
tools: composer:v2.3
- name: "Run PHP lint"
run: "composer ci:php:lint"
strategy:
fail-fast: false
matrix:
php-version:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
code-quality:
name: "Code quality checks"
runs-on: ubuntu-20.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
tools: composer:v2.3
- name: "Show Composer version"
run: composer --version
- name: "Cache dependencies installed with composer"
uses: actions/cache@v3
with:
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-composer-\n"
- name: "Install Composer dependencies"
run: "composer install --no-progress"
- name: "Run command"
run: "composer ci:${{ matrix.command }}"
strategy:
fail-fast: false
matrix:
command:
- "composer:normalize"
- "json:lint"
- "php:copypaste"
- "php:cs-fixer"
- "php:sniff"
- "php:stan"
- "ts:lint"
- "yaml:lint"
php-version:
- 7.4
code-quality-frontend:
name: "Code quality frontend checks"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
command:
- "style"
- "js"
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install modules"
run: yarn
- name: "Run command"
run: "yarn lint:${{ matrix.command }}"
xliff-lint:
name: "Xliff linter"
runs-on: ubuntu-20.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Run the xliff lint"
uses: TYPO3-Continuous-Integration/TYPO3-CI-Xliff-Lint@v1
unit-tests:
name: "Unit tests"
runs-on: ubuntu-20.04
needs: php-lint
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
tools: composer:v2.3
- name: "Show Composer version"
run: composer --version
- name: "Cache dependencies installed with composer"
uses: actions/cache@v3
with:
key: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n"
- name: "Install TYPO3 Core"
env:
TYPO3: "${{ matrix.typo3-version }}"
run: |
composer require --no-ansi --no-interaction --no-progress --no-install typo3/minimal:"$TYPO3"
composer show
- name: "Install lowest dependencies with composer"
if: "matrix.composer-dependencies == 'lowest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
composer show
- name: "Install highest dependencies with composer"
if: "matrix.composer-dependencies == 'highest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies
composer show
- name: "Run unit tests"
run: "composer ci:tests:unit"
strategy:
fail-fast: false
matrix:
include:
- typo3-version: ^10.4
php-version: 7.2
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.2
composer-dependencies: lowest
- typo3-version: ^10.4
php-version: 7.3
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.3
composer-dependencies: lowest
- typo3-version: ^10.4
php-version: 7.4
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.4
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 7.4
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 7.4
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 8.0
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 8.0
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 8.1
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 8.1
composer-dependencies: lowest
functional-tests:
name: "Functional tests"
runs-on: ubuntu-18.04
needs: php-lint
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
tools: composer:v2.3
extensions: mysqli
coverage: none
- name: "Show Composer version"
run: composer --version
- name: "Cache dependencies installed with composer"
uses: actions/cache@v3
with:
key: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n"
- name: "Install TYPO3 Core"
env:
TYPO3: "${{ matrix.typo3-version }}"
run: |
composer require --no-ansi --no-interaction --no-progress --no-install typo3/minimal:"$TYPO3"
composer show
- name: "Install lowest dependencies with composer"
if: "matrix.composer-dependencies == 'lowest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
composer show
- name: "Install highest dependencies with composer"
if: "matrix.composer-dependencies == 'highest'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies
composer show
- name: "Start MySQL"
run: "sudo /etc/init.d/mysql start"
- name: "Run functional tests"
run: |
export typo3DatabaseName="typo3";
export typo3DatabaseHost="127.0.0.1";
export typo3DatabaseUsername="root";
export typo3DatabasePassword="root";
composer ci:tests:functional
strategy:
fail-fast: false
matrix:
include:
- typo3-version: ^10.4
php-version: 7.2
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.2
composer-dependencies: lowest
- typo3-version: ^10.4
php-version: 7.3
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.3
composer-dependencies: lowest
- typo3-version: ^10.4
php-version: 7.4
composer-dependencies: highest
- typo3-version: ^10.4
php-version: 7.4
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 7.4
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 7.4
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 8.0
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 8.0
composer-dependencies: lowest
- typo3-version: ^11.5
php-version: 8.1
composer-dependencies: highest
- typo3-version: ^11.5
php-version: 8.1
composer-dependencies: lowest
39 changes: 24 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
/node_modules
/Resources/Private/Sass/.sass-cache

### ide
*.idea
*.iml
nbproject
*.swp
*.kdev4

### os
*.swp
.DS_Store
thumbs.db
desktop.ini
.directory

### composer artifacts
/*.idea
/.Build/*
/.php-cs-fixer.cache
/.phpunit.result.cache
/Documentation-GENERATED-temp/
/Resources/Private/Sass/.sass-cache
/Resources/Private/node_modules/
/Resources/Private/package-lock.json
/Resources/Private/yarn-error.log
/Resources/Private/yarn.lock
/build
/clover.xml
/composer.lock
/nbproject
/node_modules
/node_modules/
/package-lock.json
/public
/var
/vendor

### locally rendered docs
/*GENERATED*
/yarn-error.log
/yarn.lock
desktop.ini
nbproject
thumbs.db
Loading

0 comments on commit bfe3cba

Please sign in to comment.