Skip to content

Commit

Permalink
Merge pull request #265 from hoogi91/develop
Browse files Browse the repository at this point in the history
Major Release 3.0.0
  • Loading branch information
hoogi91 committed Jun 21, 2023
2 parents f2d8b41 + 2ea7820 commit cc24e0e
Show file tree
Hide file tree
Showing 87 changed files with 9,165 additions and 6,131 deletions.
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,40 @@
{
"name": "typo3-charts",
"image": "ghcr.io/hoogi91/typo3/php:8.2",
"runArgs": [
"--name",
"typo3-charts"
],
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "18"
}
},
"customizations": {
"vscode": {
"settings": {
"php.executablePath": "/usr/local/bin/php",
"php.executables": {
"8.2": "/usr/local/bin/php"
}
},
"extensions": [
"EditorConfig.EditorConfig",
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"DEVSENSE.phptools-vscode",
"DEVSENSE.composer-php-vscode",
"MehediDracula.php-namespace-resolver",
"benjaminkott.typo3-typoscript",
"kamediendesign.typo3-fluid",
"christian-kohler.npm-intellisense",
"trabpukcip.vscode-npm-scripts"
],
}
},
"postStartCommand": "apache2ctl start",
"postCreateCommand": ".devcontainer/postCreate.sh",
"otherPortsAttributes": {
"onAutoForward": "ignore"
}
}
18 changes: 18 additions & 0 deletions .devcontainer/postCreate.sh
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -x

composer install
.Build/bin/typo3 install:setup -f -n \
--database-driver=pdo_sqlite \
--admin-user-name=admin \
--admin-password=\$Password2 \
--site-name="TYPO3 Devcontainer" \
--site-setup-type=site \
--web-server-config=apache

.Build/bin/typo3 configuration:set SYS/trustedHostsPattern '.*'
.Build/bin/typo3 configuration:set SYS/features/security.backend.enforceReferrer false --json

sudo chmod a+x "$(pwd)"
sudo rm -rf /var/www/html
sudo ln -s "$(pwd)/.Build/web/" /var/www/html
5 changes: 2 additions & 3 deletions .eslintrc.js
Expand Up @@ -5,10 +5,9 @@ module.exports = {
node: true,
es6: true
},
parser: "babel-eslint",
parser: "@babel/eslint-parser",
parserOptions: {
sourceType: "module",
parser: "babel-eslint"
sourceType: "module"
},
extends: [
"eslint:recommended"
Expand Down
49 changes: 49 additions & 0 deletions .github/actions/composer/action.yml
@@ -0,0 +1,49 @@
name: 'Install php and composer dependencies'
description: 'This action sets up PHP and installs deps using composer.'
inputs:
php-version:
required: true
description: 'PHP Version to use'
extensions:
required: false
description: 'PHP extensions to install'
default: ''
dependencies:
required: false
description: 'Instruction which composer dependencies to install - one of "highest", "lowest", defaults to "locked"'
default: 'locked'
runs:
using: 'composite'
steps:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ inputs.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: "${{ inputs.extensions }}"

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ inputs.php-version }}-${{ inputs.dependencies }}"
restore-keys: "php-${{ inputs.php-version }}-${{ inputs.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ inputs.dependencies == 'lowest' }}
shell: bash
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ inputs.dependencies == 'highest' }}
shell: bash
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ inputs.dependencies == 'locked' }}
shell: bash
run: "composer install --no-interaction --no-progress"
24 changes: 24 additions & 0 deletions .github/actions/npm/action.yml
@@ -0,0 +1,24 @@
name: 'Install npm dependencies'
description: 'This action sets up Nodejs and installs deps using npm.'
inputs:
node-version:
required: true
description: 'Node Version to use'
runs:
using: 'composite'
steps:
- name: "Setup Node.js"
uses: "actions/setup-node@v2"
with:
node-version: "${{ inputs.node-version }}"

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: ~/.npm
key: "npm-${{ inputs.node-version }}-${{ hashFiles('package-lock.json') }}"
restore-keys: "npm-${{ inputs.node-version }}"

- name: "Install dependencies"
shell: bash
run: "npm ci --ignore-scripts"
49 changes: 49 additions & 0 deletions .github/actions/phpunit/action.yml
@@ -0,0 +1,49 @@
name: 'Execute phpunit tests'
description: 'This action executes phpunit tests with support for coverage generation.'
inputs:
coverage:
required: false
description: 'Enable coverage'
default: 'false'
coverage-folder:
required: false
description: 'Folder to save coverage reports into'
default: './coverage/'
whitelist:
required: false
description: 'PHPUnit whitelist'
default: './Classes/'
runs:
using: 'composite'
steps:
- name: Unit tests
if: inputs.coverage == 'false'
shell: bash
run: |
if [ -d "Tests/Unit" ]; then
.Build/bin/phpunit --bootstrap Tests/bootstrap.php Tests/Unit/
fi
- name: Functional tests
if: inputs.coverage == 'false'
shell: bash
run: |
if [ -d "Tests/Functional" ]; then
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Functional test suite {}"; .Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php {}'
fi
- name: Unit tests with coverage
if: inputs.coverage != 'false'
shell: bash
run: |
if [ -d "Tests/Unit" ]; then
.Build//bin/phpunit --bootstrap Tests/bootstrap.php Tests/Unit/ --coverage-clover=${{ inputs.coverage-folder }}unit/clover.xml --coverage-filter=${{ inputs.whitelist }}
fi
- name: Functional tests with coverage
if: inputs.coverage != 'false'
shell: bash
run: |
if [ -d "Tests/Functional" ]; then
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Functional test suite {}"; .Build//bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php {} --coverage-clover=${{ inputs.coverage-folder }}functional/{}/clover.xml --coverage-filter=${{ inputs.whitelist }}'
fi
20 changes: 20 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,20 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
versioning-strategy: widen

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "monthly"
26 changes: 26 additions & 0 deletions .github/workflows/auto-approve.yml
@@ -0,0 +1,26 @@
name: "Dependabot Pull Request Approve and Merge"

on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
name: "Dependabot auto-approve"
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- name: Approve Dependabot PRs
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112 changes: 0 additions & 112 deletions .github/workflows/ci.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/coding-standards.yml
@@ -0,0 +1,34 @@
name: "Check Coding Standards"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check Coding Standards"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "8.2"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Composer install"
uses: ./.github/actions/composer
with:
php-version: '${{ matrix.php-version }}'
dependencies: '${{ matrix.dependencies }}'
extensions: json, mbstring

- name: "Coding Standard"
run: .Build/bin/phpcs -q --report=checkstyle | cs2pr

0 comments on commit cc24e0e

Please sign in to comment.